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. vsftpd : cannot login with non-anonymous user ...
    By debellez in forum Linux - Hardware, Networking & Security
    Replies: 8
    Last Post: 05-10-2006, 07:12 PM
  2. PHP Tutorial
    By Waka-Gashira in forum Windows - General Topics
    Replies: 8
    Last Post: 01-27-2005, 09:10 AM
  3. PHP on IIS Server
    By genesis in forum Windows - General Topics
    Replies: 8
    Last Post: 01-03-2005, 12:22 PM
  4. Problem with new user login
    By geoffp in forum Announcements and Suggestions
    Replies: 3
    Last Post: 10-11-2003, 05:10 AM
  5. PHP takes ASP as Number 1 SSSL
    By coltrane in forum Linux - Software, Applications & Programming
    Replies: 0
    Last Post: 07-04-2002, 03:47 AM

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
  •