+ Reply to Thread
Results 1 to 4 of 4

Thread: help getting freaky error

  1. #1
    hyeclass is offline x10 Sophmore hyeclass is an unknown quantity at this point
    Join Date
    Dec 2005
    Posts
    174

    help getting freaky error

    PHP Code:
    <?
    if ($logged[gebruiker])
    {
    setcookie("id"2132421,time()+(60*60*24*5), "/""");
    setcookie("pass"loggedout,time()+(60*60*24*5), "/""");
    echo (
    "You are now logged out! <br>");
    header('Location: index.php');
    }
    else
    {
    $loginform "<form name=\"form1\" method=\"post\" action=\"\">
      <table width=\"100\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
        <tr>
          <td>Gebruikersnaam:</td>
          <td><input name=\"username\" type=\"text\" id=\"usern\"></td>
        </tr>
        <tr>
          <td>Wachtwoord</td>
          <td><input name=\"pass\" type=\"text\" id=\"pass\"></td>
        </tr>
      </table>
      <input type=\"submit\" name=\"Submit\" value=\"Submit\">
    </form>"
    ;
    echo 
    "$loginform";
    if (
    $_POST[Submit])
    {
    $query mysql_query("SELECT * FROM users WHERE gebruiker = '$username'") or die(mysql_error());
    $user mysql_fetch_array($query);
    $username $_POST['username'];
    $pass md5($_POST['pass']);
    if (!
    $user[pass] == $pass)
    {
    echo 
    "Er klopt iets niet met de ingegeven data<br>";
    }
    else
    {
    $query mysql_query("SELECT * FROM users WHERE gebruiker = '$username'") or die(mysql_error());
    $user mysql_fetch_array($query);
    setcookie("id"$user[id],time()+(60*60*24*5));
    setcookie("pass"$pass,time()+(60*60*24*5)); 
    echo 
    "je bent nu ingelogd";
    }
    }
    }
    ?>
    Warning: Cannot modify header information - headers already sent by (output started at /home/kaotix/domains/kaotix-crew.net/public_html/bugz.inc/index.php:5) in /home/kaotix/domains/kaotix-crew.net/public_html/bugz.inc/loginform.php on line 39

    Warning: Cannot modify header information - headers already sent by (output started at /home/kaotix/domains/kaotix-crew.net/public_html/bugz.inc/index.php:5) in /home/kaotix/domains/kaotix-crew.net/public_html/bugz.inc/loginform.php on line 40

    i'm getting that erro but cant see why and there is no whitespace in my code after the or befor the php tags anywhere if you want i can post the index file too

    thank you in advance
    http://x-pose.tk

    http://bugz-inc.tk

  2. #2
    lambada's Avatar
    lambada is offline x10 Elder lambada is an unknown quantity at this point
    Join Date
    Mar 2006
    Location
    Caister, Gt Yarmouth, Norfolk, ENGLAND
    Posts
    1,222

    Re: help getting freaky error

    I tink that code is valid except for this:
    Code:
    setcookie("id", 2132421,time()+(60*60*24*5), "/", "");
    setcookie("pass", loggedout,time()+(60*60*24*5), "/", "");
    echo ("You are now logged out! <br>");
    header('Location: index.php');
    Try moving the header() to above the echo().
    I can't see any real problem with your code there, but I suspect it is to do with the nested if()statements, try using either elseif() statements, or use switch with case statements.

    I prefer the latter as it creates what I feel is more readable code, but the choice is yours.
    Lambada - the former Account Manager (before I resigned)




  3. #3
    hyeclass is offline x10 Sophmore hyeclass is an unknown quantity at this point
    Join Date
    Dec 2005
    Posts
    174

    Re: help getting freaky error

    you are right i think its best to replace it with an echo of a html redirect :D i'll let you know what happened
    http://x-pose.tk

    http://bugz-inc.tk

  4. #4
    hyeclass is offline x10 Sophmore hyeclass is an unknown quantity at this point
    Join Date
    Dec 2005
    Posts
    174

    Re: help getting freaky error

    it turns out thats not the cause at all. :D
    in my index.php i had liek this :
    -html
    php < my include config was here
    -html

    -html < shoudl be here include("config.php") or whatever :D
    php
    -html
    http://x-pose.tk

    http://bugz-inc.tk

+ Reply to Thread

Similar Threads

  1. Internal Server Error
    By repusmod in forum Free Hosting
    Replies: 16
    Last Post: 06-19-2006, 01:53 PM
  2. {req} Banners
    By SEŅOR in forum The Marketplace
    Replies: 23
    Last Post: 01-05-2006, 03:15 PM
  3. 500 Internal Server Error
    By S_W_A_T in forum Free Hosting
    Replies: 9
    Last Post: 10-18-2005, 02:38 PM
  4. server error
    By elven in forum Free Hosting
    Replies: 17
    Last Post: 09-29-2005, 09:24 AM
  5. Internal Sever Error
    By Gun Mac in forum Free Hosting
    Replies: 0
    Last Post: 09-19-2005, 03:00 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers