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
Did you know?Explore Trending and Topic pages for more stories like this.
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
11
Other forums
Multi Level Array Problem
hi all,
For example I have array like below:
$temp = array(array('north america', 'us'
Function
How can I make this function that once you click the link in the code it takes you to a new page wit
Saving data from a form into a file
Hey everybody,
Sorry, I am really new to PHP coding and such but a project kind of got thrust
SAP Logon Failed
I tried to login to SAP through MMC.
When i click start and give password.
it
Am I setting up my sites oldschool?
Ok,
When I create a site I open a basic template that I have created that consists of a css f
Script not running properly
Hello Everyone
This is a basic script for posting to a database. I'm not sure why it doesn't work
How would I protect......
I have a from, actually, a good amount of forms. How can I make it so you can't type the characters:
Wierd echo error?
Hi, i got the most wierd php error ever and i don't know why..
Code: echo "<t
SQL Query/echo not working
Hey all,
I'm trying to run (what I thought) was a simple operation and it isn't working. I h
Alterar a hora do servidor
Se alguém souber, ajude-me a adicionar 6 horas, obrigado
<tr>
&