Why does that mean that they have to be on a separate line in the file? Surely you could just read them in, explode() them into an array and create the list box? Or do you have some other code that cannot be changed that generates the list box?
Ok Got half of it. Do not over complicate as you stated a csv is 2 dimension and what I am doing is a straight flat txt file so I can just write to a txt file
I know you’ve fixed it another way, but just so you can see another option.
Using a file to populate your list box brings forward another problem - what happens when your site has more than one user? It’s an unusual approach - what sits between the first bit of code that writes the file, and the last bit of code that reads it back in and creates a list box from it? So many other ways, such as session variables, seem better options.
I have still one small problem not sure what is wrong when using First Name space Last Name only First Name get save it looks like after space everything is omitted
Is the correct information being written to the file and read wrongly, or is it going into the file wrongly? What’s in the file? What if you do something like:
$purchases = $row[0] . " " . $row[1];
Also, if the option value is the same as the text you display inside the <option> </option> tags, there’s no need to put it in. You only need to specify the value when it’s different:
Well, it will do. Look at what you have in the value field - just the first name, so that’s all that is submitted in the $_POST array. You need to put both in there, as you do in the description, or leave the value out altogether as I mentioned above. You seem to be putting the last name in as a separate parameter for some reason.
That would only work if both names were going into the file, but comma-separated.