+ Post New Thread
Page 2 of 2 FirstFirst 12
Results 16 to 24 of 24
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?...
  1. #16

    CESIL's Avatar
    Join Date
    Nov 2006
    Location
    Hampshire
    Posts
    1,405
    Thank Post
    109
    Thanked 267 Times in 198 Posts
    Rep Power
    169
    have you tried with a different computer/browser yet?

    maybe IE8 has stricter/different security that is affecting cookies?

  2. #17

    tmcd35's Avatar
    Join Date
    Jul 2005
    Location
    Norfolk
    Posts
    6,053
    Thank Post
    896
    Thanked 1,008 Times in 821 Posts
    Blog Entries
    9
    Rep Power
    349
    Okay, earlier I changed the

    Code:
    if ($_SESSION['status'] == 8)
    to

    Code:
    if($_POST['tag'] != null)
    it worked! But any reference to session variable within the IF statement didn't

    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!

  3. #18

    tmcd35's Avatar
    Join Date
    Jul 2005
    Location
    Norfolk
    Posts
    6,053
    Thank Post
    896
    Thanked 1,008 Times in 821 Posts
    Blog Entries
    9
    Rep Power
    349
    Quote Originally Posted by cadjs View Post
    have you tried with a different computer/browser yet?

    maybe IE8 has stricter/different security that is affecting cookies?
    Firefox gives exactly the same results! I think it's a backend php problem. Not sure what though...

  4. #19

    CESIL's Avatar
    Join Date
    Nov 2006
    Location
    Hampshire
    Posts
    1,405
    Thank Post
    109
    Thanked 267 Times in 198 Posts
    Rep Power
    169
    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

  5. #20

    tmcd35's Avatar
    Join Date
    Jul 2005
    Location
    Norfolk
    Posts
    6,053
    Thank Post
    896
    Thanked 1,008 Times in 821 Posts
    Blog Entries
    9
    Rep Power
    349
    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.

  6. #21
    budgester's Avatar
    Join Date
    Jan 2006
    Location
    Enfield, Middlesex
    Posts
    486
    Thank Post
    4
    Thanked 38 Times in 30 Posts
    Rep Power
    25
    When things start erroring in PHP, the best things to are the following.

    At the top of your PHP script add

    error_reporting(E_ALL);

    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

    KCachegrind
    SourceForge.net: WinCacheGrind

    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.

  7. #22
    budgester's Avatar
    Join Date
    Jan 2006
    Location
    Enfield, Middlesex
    Posts
    486
    Thank Post
    4
    Thanked 38 Times in 30 Posts
    Rep Power
    25
    Quote Originally Posted by tmcd35 View Post
    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.
    Try adding to your code:

    print_r($_POST);
    print_r($_SESSIONS);

    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.

  8. Thanks to budgester from:

    tmcd35 (27th February 2009)

  9. #23
    budgester's Avatar
    Join Date
    Jan 2006
    Location
    Enfield, Middlesex
    Posts
    486
    Thank Post
    4
    Thanked 38 Times in 30 Posts
    Rep Power
    25
    Quote Originally Posted by tmcd35 View Post
    Code:
     
              echo "<form action=\"module/thispage.php\" method=\"post\"><tr>";
    Do you need to escape the "/" e.g.
    Code:
              echo "<form action=\"module\/thispage.php\" method=\"post\"><tr>";
    or you could use single quotes to around the whole statement and then not have to escape the double quotes.

    Code:
              echo '<form action="module/thispage.php" method="post"><tr>';
    You also have to be carefull on the directory seperator.

    "/" is usually a unix directory seperator

    "\" is a windows directory seperator

    Plenty of options that could be causing you fun.

  10. #24

    tmcd35's Avatar
    Join Date
    Jul 2005
    Location
    Norfolk
    Posts
    6,053
    Thank Post
    896
    Thanked 1,008 Times in 821 Posts
    Blog Entries
    9
    Rep Power
    349
    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.



SHARE:
+ Post New Thread
Page 2 of 2 FirstFirst 12

Similar Threads

  1. Best Site to learn php and mysql?
    By My220x in forum Coding
    Replies: 11
    Last Post: 23rd April 2008, 09:58 AM
  2. Can't get mysql and PHP to play together on IIS
    By dagza in forum Web Development
    Replies: 5
    Last Post: 20th January 2008, 04:38 PM
  3. Creating a new database in php and mysql
    By StewartKnight in forum Web Development
    Replies: 18
    Last Post: 21st February 2007, 09:53 AM
  4. PHP MYSQL Hit counter
    By Nij.UK in forum Web Development
    Replies: 9
    Last Post: 15th November 2006, 10:11 AM
  5. php MySql
    By iking in forum Books and Manuals
    Replies: 0
    Last Post: 11th July 2005, 04:35 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •