Web Development Thread, HTTP500 error in Coding and Web Development; have you tried with a different computer/browser yet?
maybe IE8 has stricter/different security that is affecting cookies?...
27th February 2009, 02:12 PM #16
have you tried with a different computer/browser yet?
maybe IE8 has stricter/different security that is affecting cookies?
27th February 2009, 02:18 PM #17
Okay, earlier I changed the
if ($_SESSION['status'] == 8)
it worked! But any reference to session variable within the IF statement didn't
if($_POST['tag'] != null)
Now I've added those two echo statements into the IF block and low and behold the if block is NOT being processed.
If POST['tag'] was null it'd display the form? but since it's not null (form submitted), it doesn't appear to be processing the IF statement!
27th February 2009, 02:24 PM #18
Firefox gives exactly the same results! I think it's a backend php problem. Not sure what though...
Originally Posted by cadjs
27th February 2009, 03:07 PM #19
are you sure the form action path is correct?
it seems to be pointing to a file in another folder...if you leave the action blank then it will reload the form by default anyway
edit: actually even if that was the case the session vars would still be visible assuming the next file also has a session_start
27th February 2009, 03:23 PM #20
form action path is correct and the file is being loaded. The echo session_id(); after the session_start(); proves this. I think I may have to re-write the file from scratch and see if the problem gets re-created on a re-write.
The problem is, the code for displaying the data entry form and the table beneath that is quite complex and I don't fancy giving it a complete re-write - once was hard enough.
There appears to be a problem with the PHP passing but I can't see anything obvious. The passing of $_SESSIONS and $_POST variables seem to be a bit hit and miss.
It does appear that the session id is following and some session variables are to. $_SESSION['status'] appears to be being reset to 0 for some reason.
27th February 2009, 03:26 PM #21
When things start erroring in PHP, the best things to are the following.
At the top of your PHP script add
From PHP: error_reporting - Manual
Next look in you webserver logs.
HTTP Error 500 Internal server for php pages and solution
Next if the program is really complicated start a testing framework.
SimpleTest - Unit Testing for PHP
Then you can get into performance tuning with tools such as cachegrind
This can be usefull if you are doing database calls and experiencing slowdowns. You'll usually find your making a lot of calls in a loop somewhere.
27th February 2009, 03:29 PM #22
Try adding to your code:
Originally Posted by tmcd35
This will dump out all the post and session variables.
It could also be to do with sending a post variable with out a value.
Thanks to budgester from:
tmcd35 (27th February 2009)
27th February 2009, 03:37 PM #23
Do you need to escape the "/" e.g.
Originally Posted by tmcd35
or you could use single quotes to around the whole statement and then not have to escape the double quotes.
echo "<form action=\"module\/thispage.php\" method=\"post\"><tr>";
You also have to be carefull on the directory seperator.
echo '<form action="module/thispage.php" method="post"><tr>';
"/" is usually a unix directory seperator
"\" is a windows directory seperator
Plenty of options that could be causing you fun.
4th March 2009, 12:42 PM #24
Thanks to everyone who replied. As you'd have probably guessed it was down to user error
both $_SESSION and $_POST variables where transferring fine. I just needed to keep better track as to what was being contained in each and when.
The $_SESSION['status'] variable is still containing the wrong value = '0' instead of '8', but I worked around it (not used that variable at this point) and everything is fine.
Thanks again for the help.
By My220x in forum Coding
Last Post: 23rd April 2008, 08:58 AM
By dagza in forum Web Development
Last Post: 20th January 2008, 03:38 PM
By StewartKnight in forum Web Development
Last Post: 21st February 2007, 08:53 AM
By Nij.UK in forum Web Development
Last Post: 15th November 2006, 09:11 AM
By iking in forum Books and Manuals
Last Post: 11th July 2005, 03:35 PM
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)