Page 1 of 1

php error

Posted: Thu Nov 01, 2012 8:08 pm
by BandanaChaudhury
I am getting an error,
Notice: Undefined index: trip in C:\xampp\htdocs\Travelpoint.com\tdomestic.php on line 5.
And in line 5 it's written,
$trip = $_POST['trip'];
How to rectify it?

Re: php error

Posted: Thu Nov 01, 2012 9:06 pm
by MeroD
Use var_dump($_POST) to examine the variables/array sent to your script...

Re: php error

Posted: Fri Nov 02, 2012 8:15 am
by BandanaChaudhury
Then also same problem,
but now it is also displaying NULL after it.

Re: php error

Posted: Fri Nov 02, 2012 2:27 pm
by seandisanti
You're accessing a property that doesn't exist in the context in which you're accessing it. specifically the 'trip' post element. make sure that isset($_POST) before acting upon post elements, and if you're still having issues, you've probably typo'd the name of the field in your form that is posting data to the page. For more specific help, post the code for the form (including the form tag) and/or the php code that is failing

Re: php error

Posted: Sat Nov 03, 2012 10:59 pm
by BandanaChaudhury
thank you,
it's solved now.