Results 1 to 3 of 3

Thread: PHP User Login Design Problem

  1. #1
    Junior Member
    Join Date
    Jan 2005
    Location
    B.C. Canada
    Posts
    74

    Thumbs up

    HI, Guys!

    I have a problem of using PHP to develop a user login for the restricted webpages of my website....

    I need your help! :unsure:

    Could you tell me what's wrong with the coding?[the BOld & highlighted line below]

    <html>

    <head>
    <title>Jason&#39;s Photo Album</title>
    </head>

    <body bgcolor="white" text="black" link="black" vlink="#666666" alink="#999999" leftmargin="0" marginwidth="0" topmargin="0" marginheight="0">
    <p align="center"><font face="Arial">


    <?php

    $user = "Ducky"; #This is the username you login with
    $password = "yogatogapi"; #This is the password you login with

    if($_POST["name"]==$user) {
    if($_POST["pass"]==$password) {
    ? #If username and password is correct
    ? <meta http-equiv="refresh"? content="0;URL=http://wwww.something.com/JasonsPhotoAlbum.html">
    ?*
    }else{
    ? #If username is correct but password isn&#39;t
    ? echo "The password you entered was invalid!";
    }
    }else{
    if($_POST["pass"]==$password) {
    ? #The username was wrong but the password wasn&#39;t
    ? echo "The username you provided was invalid!";
    ? }else{
    ? #The username and password were both wrong
    ? echo "The username and password you provided was invalid!";
    }
    }

    ?>

    </font></p>

    </body>

    </html>
    Thank you very much!

  2. #2
    Mentor
    Join Date
    Aug 2004
    Location
    Toronto, Canada
    Posts
    1,159
    Code:
    header("Location: http://www.msforums.org");
    Not sure what exactly is happening, would this work?

  3. #3
    Junior Member
    Join Date
    Jan 2005
    Location
    B.C. Canada
    Posts
    74
    It returns an RUNTIME ERROR when I proceed login!

    Warning: Cannot modify header information - headers already sent by (output started at D:\--------\login.php:10) in D:\--------\login.php on line 18
    Do you have any idea why this runtime error occured?

Similar Threads

  1. 1 user can't login in LDAP
    By naerey in forum Linux - Hardware, Networking & Security
    Replies: 1
    Last Post: 09-06-2011, 11:10 AM
  2. Wuftp-Login for System User
    By honey bee in forum Linux - General Topics
    Replies: 0
    Last Post: 09-01-2007, 05:59 AM
  3. single user login. no login at startup
    By donovan in forum Linux - General Topics
    Replies: 3
    Last Post: 01-12-2005, 08:57 AM
  4. Problem with new user login
    By geoffp in forum Announcements and Suggestions
    Replies: 3
    Last Post: 10-11-2003, 05:10 AM
  5. Changing user login to GUI
    By rolltidega in forum Redhat / Fedora
    Replies: 4
    Last Post: 10-16-2002, 08:23 PM

Bookmarks

Posting Permissions

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