Internal Server Error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kashmirekat
    Junior Member
    • Jun 2004
    • 8

    #1

    Internal Server Error

    This script previously worked on a different host before I moved here. I just had to change the db name, but now I get an Internal Server Error and I just don't know why. Any help would be appreciated.

    My login form:
    PHP Code:
    <form method=post action="validate.php">
    &
    nbspUsername:<BR>
    &
    nbsp; <input type="text" name="username" class="iboxes"><BR>
    &
    nbspPassword:<BR>
    &
    nbsp; <input type="password" name="password" class="iboxes"><BR>
    &
    nbsp; <input type="submit" name="submit" class="sbutton" value="Log In">
    </
    form
    Validate.php
    PHP Code:
    /* Check User Script */ 
    session_start();  // Start Session 
    // Convert to simple variables 
    $username $_POST['username']; 
    $password $_POST['password']; 
    if((!
    $username) || (!$password)){ 
        
    header("Location: relogin.php");
        exit(); 


    if (
    $submit) {
    $db mysql_connect(localhost,<username>,<pass>) or die("Unable to connect to database");
    mysql_select_db ("<dbname>"); 
    $result=mysql_query("select * from users where name='$username' && password='$password'") or die ("Username and password combination not found.");
    while (
    $row=mysql_fetch_array($result)) {
    if (
    $row["password"]==$password && $row["name"]==$username) {
    header($row["url"]);
     
    // Register some session variables! 
            
    session_register('username'); 
            
    $_SESSION['username'] = $username
    exit();
    }
    }
     
    header("Location: relogin.php");

    Thank you.
    Have a nice day.
  • bd2003
    Junior Member
    • Mar 2004
    • 20

    #2
    have you looked at your log files?
    checked permissions?

    Comment

    • kashmirekat
      Junior Member
      • Jun 2004
      • 8

      #3
      Permissions are all at 777.

      Here's the error log:
      PHP Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/zen/public_html/ld/relogin.php:3) in /home/zen/public_html/ld/login_form.php on line 3
      [29-Jun-2004 22:09:37] PHP Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/zen/public_html/ld/relogin.php:3) in /home/zen/public_html/ld/login_form.php on line 3
      [29-Jun-2004 22:09:37] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/zen/public_html/ld/relogin.php:3) in /home/zen/public_html/ld/login_form.php on line 8
      Last edited by kashmirekat; 06-29-2004, 09:57 PM.

      Comment

      • Jonathan
        Senior Member
        • Mar 2004
        • 1229

        #4
        PHPsuexec does not allow for 777...try 755.
        "How can someone be so distracted yet so focused?"
        - C

        Comment

        • kashmirekat
          Junior Member
          • Jun 2004
          • 8

          #5
          Still getting the same dog gone error...

          Comment

          • kashmirekat
            Junior Member
            • Jun 2004
            • 8

            #6
            It's working now. I played with it a little bit and may a few slight changes. Now if only I knew what changes I made to make it work...

            Thank you for all ya'll's help.
            Have a nice day.

            Comment

            • bd2003
              Junior Member
              • Mar 2004
              • 20

              #7
              Originally posted by kashmirekat
              It's working now. I played with it a little bit and may a few slight changes. Now if only I knew what changes I made to make it work...

              Thank you for all ya'll's help.
              Have a nice day.
              been there, gone through that.. sometimes it's worse not knowing why something is working than it is not knowing why it isn't working...

              Comment

              Working...