Search found 10 matches

by jlimbo
Mon Sep 13, 2010 8:19 am
Forum: PHP - Code
Topic: Handling forms
Replies: 6
Views: 689

Re: Handling forms

Thanks Tim, I've just changed that. I was actually about to mark this is resolved as I finally worked out the problem this morning. It turns the problem was purely that I hadn't added 'session_start()' in the form handler and so the query was running ok but the reponse was being lost Thanks again John
by jlimbo
Wed Sep 08, 2010 11:19 am
Forum: PHP - Code
Topic: Handling forms
Replies: 6
Views: 689

Re: Handling forms

Here you go <form name='loginForm' id='loginForm' class='login' action='formProcessor.php' method='post'><input type='hidden' name='form' value='login' /> <div class = 'formRow'><p> <span class='formLeftCol'> <label for='uname'>Username: </label> </span> <input type='text' name='uname' id='uname' cl...
by jlimbo
Wed Sep 08, 2010 8:08 am
Forum: PHP - Code
Topic: Handling forms
Replies: 6
Views: 689

Re: Handling forms

Tried that. but the test still fails and runs the else clause.
by jlimbo
Tue Sep 07, 2010 11:31 am
Forum: PHP - Code
Topic: Handling forms
Replies: 6
Views: 689

Handling forms

Right, this is a slightly odd one but here we go. I've got a form that posts its values to a script which starts with the line if($_POST['form'] == 'login') { That should be as straightforward as it gets. But php tells me the index 'form' is undefined. But here's the kicker, when I look at the conte...
by jlimbo
Sat Nov 21, 2009 6:59 am
Forum: PHP - Code
Topic: Trying to parse .csv
Replies: 10
Views: 113

Re: Trying to parse .csv

I just replaced the source csv file and now it all works ok. Thanks all for your help

John
by jlimbo
Fri Nov 20, 2009 10:01 am
Forum: PHP - Code
Topic: Trying to parse .csv
Replies: 10
Views: 113

Re: Trying to parse .csv

The if (is_array)... check should check every row individually as it is declared in the while loop.
by jlimbo
Fri Nov 20, 2009 9:24 am
Forum: PHP - Code
Topic: Trying to parse .csv
Replies: 10
Views: 113

Re: Trying to parse .csv

Ok, I've put a check in code as follows, which gets rid of the warning but displays "Error". $row, therefore is not an array, I get that. But it should keep running the fgetcsv til the eof is reached. Therefore, unless the file is empty (which it isn't) then the remining rows in the file s...
by jlimbo
Fri Nov 20, 2009 8:25 am
Forum: PHP - Code
Topic: Trying to parse .csv
Replies: 10
Views: 113

Re: Trying to parse .csv

That should be taken care of by the while loop. The fgetcsv should only therefore execute when there is something for it to read
by jlimbo
Thu Nov 19, 2009 10:10 pm
Forum: PHP - Code
Topic: Trying to parse .csv
Replies: 10
Views: 113

Re: Trying to parse .csv

The error message is
Warning: Invalid argument supplied for foreach() in C:\wamp\www\flightPoints\flightPoints.php on line 9
Tried to print $row, but no output
by jlimbo
Thu Nov 19, 2009 9:37 pm
Forum: PHP - Code
Topic: Trying to parse .csv
Replies: 10
Views: 113

Trying to parse .csv

I'm trying to parse a csv file via php. The code below worked except for a warning about an invalid argument in the foreach() statement. I tried a couple of things to rectify the problem and none worked. I have completely removed all the changes (double and triple checked) and now I only get the war...