Undefined offset when using a flat file with pipe symbols


Posted on 16th Feb 2014 07:03 pm by admin

Hi, I've got a flat file/text file which I'm currently using as a member database for my site (not advisable I know.. but still learning here).

In a section of code I need to separate the fields to make various checks later in the code

I use this line to do that..

list ($name, $pass, $fileidnumber) = split ('|', $line);

Yet.. I keep getting "undefined offset" messages.. even when all 3 fields are filled in for all records.. eg..
Fred|bonkers|3n

Is it the new line causing the problem?

Also, the server is a bit peculiar in behaviour, it won't let me upload empty text files to start with (0kb).. the only way around it is for me to add a blank line or something to make it at least 1kb so the server notices it.. so in other words.. if Fred's record was the only one in the database, there'd be a space (I guess) underneath his record (all future records are added to the top of the file, but the space will always come last when checking)

If anyone out there can help or give ideas as to why this is happening I'd be grateful.. thanks

No comments posted yet

Your Answer:

Login to answer
190 Like 11 Dislike
Previous forums Next forums
Other forums

Loosing changed contents when used FM REUSE_ALV_GRID_DISPLAY
Hi,

I have used FM REUSE_ALV_GRID_DISPLAY in my program as below.

CALL FUNCT

Page not Loading After Test
Hey All

It seemed that an inlcude statement wasn't working for some reason, so I tried a more

reorder sql query
ok so i have this very simple code:
Code: $query = "SELECT search_keywords, COUNT(search_key

Count number of records in all the tables with a querry URGENT PLEASE...
I downloaded ORACLE 9I DATA DUMP into my comp. There are number of tables. I need to find out the

value not going in data base
hello friends....
i am having a working javascript....when i am selecting any

Count Session and Trigger Events
I am New in PHP, seeking a method to count logged users by counting the sessions or any …, is

RadioButtonList item spacing
I have a RadioButtonList and I can't put any spacing between the items. They are arranged verticall

order by date not ID number help php
I am trying to orginize the following code to order by date not id number.
any help would be grea

how to get IP address?
hey guys,

i have this code which is supposed to get me the IP address of my site visitors:

highlighting search terms
well, I started this in the regular PHP section, but it no longer fits there. Suffice it to say, I'm

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash