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

190 Like 11 Dislike
Previous php-forum Next php-forum
Other php-forum

OOP help
okay so i have a class im making it has everything setup i just need to randomize the 2 variables an

having a small php error tha deals with the 'foreach'
Last night i was working on a script for a cart and it seemed to working good, until this morning. F

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:

Open link with largest int string first
I have the following links i would like to open either all at once or one-by-one. How would i procee

Take info from one coloum and move to another
Hi all,

I have this:
Code: [Select]$array = "SELECT stock_id FROM stocks WHERE stock_

A href problem under php
Hello...

I tried to explain the issue in an earlier post.. but was not clear enough....

image upload script not working with png
The basic process of this php code is to take the submitted file, convert it to a small JPG thumbnai

Trying to add functions to table
I have this list of characters and I'm trying to figure out what I have to do to put the results of

Downloading file (Headers)
I'm trying to make users download a file, but they must wait 60 seconds before it begins.

But

Undefined variables
hi
----------------------------------------------------------------------------------------------

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