Results 1 to 3 of 3

Thread: Include()

  1. #1
    Join Date
    Jan 2005

    Unanswered: Include()

    HI, i have a html mage. This page contains a username and password box. When the submit button is used, it processes the information using a login.php file. If any error's occur the php file echo's the error and i have put an include so it puts the error message on the html page where they enetered the details. But the echo is displayed on top of the html page. How can i choose where the echo ends up on the html page?

    Many thanks

  2. #2
    Join Date
    Dec 2004
    What i normaly do is something liek the following,

    PHP Code:
    $sql mysql_query("select * from users where username='".$_POST[username]."' and password='".$_POST[password]."'") or die(mysql_error());

    mysql_num_rows($sql)>0) {
    // user has been found and should be starting a session and redirecting him/her to site.
    $error "Sorry dude you screwed up BIGTIME";

    then you have a variable ($error) that you can place anywhere you want. using <?= $error; ?>

    (although it gets far more intrecate then that once you start highlighting the incorrect entries and making na elegant look to everything)

    hope that helps!

  3. #3
    Join Date
    Jan 2005
    Hello, thank you very much for your reply. I have now got it working thanks to all you kind people on :-)

Posting Permissions

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