Results 1 to 6 of 6
  1. #1
    Join Date
    Jun 2008
    Location
    West midlands, Birmingham.
    Posts
    2,093
    Tokens
    219

    Latest Awards:

    Default PHP Help needed.

    Hai

    I've been following a tutorial
    http://www.youtube.com/watch?v=kEvVl...eature=channel

    And these are my codes:

    Loginforms.php
    PHP Code:
    <?
    include(prehtml.php);
    ?>
    <html>
    <head>
    <title>
    Login
    </title>
    </head>
    <body>

    <!-- Login form -->
    <form action="loginforms_handler.php" method="post">
    Username <input type="text" name="username" value="username">
    Password <input type="password" name="password" value="password">
    <input type="submit" value="Login">
    </form>

    </body>
    </html>
    And this is my loginforms_handler.php
    PHP Code:
    <?
    $username 
    $_post=[username];
    $password $_post=[password];

    $con mysql_connect ('localhost''denning_test''test');
    mysql_select_db('denning_test'$con);

    $query "SELECT * FROM users WHERE username='" $username "' AND password='" $password "'";
    $run mysql_query($query);
    $results mysql_affected_rows();

    echo 
    $results
    ?>
    I get this error:

    Warning: include(prehtmlphp) [function.include]: failed to open stream: No such file or directory in /home/denning/public_html/test/loginforms.php on line 2

    Warning: include(prehtmlphp) [function.include]: failed to open stream: No such file or directory in /home/denning/public_html/test/loginforms.php on line 2

    Warning: include() [function.include]: Failed opening 'prehtmlphp' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/denning/public_html/test/loginforms.php on line 2

    Whats wrong with it? All help appreciated

  2. #2
    Join Date
    Jul 2008
    Posts
    535
    Tokens
    75

    Default

    PHP Code:
    <?
    include(prehtml.php);
    ?>
    remove that from loginforms.php

  3. #3
    Join Date
    Oct 2007
    Location
    Luton, England
    Posts
    1,548
    Tokens
    388
    Habbo
    DeejayMachoo

    Latest Awards:

    Default

    Code:
    <?
    Code:
    include(prehtml.php);
    ?>


    should be

    Code:
    <?
    include("prehtml.php");
    ?>



  4. #4
    Join Date
    Mar 2008
    Posts
    5,108
    Tokens
    3,780

    Latest Awards:

    Default

    Why are you putting parenthesis around include? It's a language construct.

  5. #5
    Join Date
    Dec 2006
    Location
    Swindon
    Posts
    3,299
    Tokens
    215
    Habbo
    dunko

    Latest Awards:

    Default

    & Your including prehtml.php which doesn't seem to exist...

  6. #6
    Join Date
    Jun 2008
    Location
    West midlands, Birmingham.
    Posts
    2,093
    Tokens
    219

    Latest Awards:

    Default

    i screwed this one
    i made a simple usersystem/chatbox and a download cms from a tut lol

Posting Permissions

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