www.webdeveloper.com
Results 1 to 2 of 2

Thread: Login Registration page

  1. #1
    Join Date
    Nov 2010
    Location
    india
    Posts
    21

    Login Registration page

    can anyone please tell me how to make a login and registration page.

    And how can i connect it with my form.

    Please help.

  2. #2
    Join Date
    May 2010
    Location
    Manila, Philippines
    Posts
    189
    HTML Code:
    <form name="frmreg" id="frmreg" method="post" action="save.php">
    First name: <input type="text" name="firstname" /><br />
    Last name: <input type="text" name="lastname" /><br />
    <input type="submit" name="cmdregister" id="cmdregister" value="Register">
    </form>

    and on your save.php you'll have the following code..

    PHP Code:
    <?php
    mysql_connect
    ('hostname','user','password') or die(mysql_error());
    mysql_select_db("databasename") or die(mysql_error());

    if(isset(
    cmdregister)){ 
     
    $sql "insert into tablename(firstname,lastname) values('".$_post['firstname']."','".$_post['lastname']."')";
      
    mysql_query($sql) or die(mysql_error());

      echo 
    '<script>alert("Successfully saved.");';
      echo 
    'window.location=\'homepage.php\'; </script>';
    }

    ?>
    The form tags are on the page named homepage.php while the php codes are on the save.php. From the first page the user encodes the information. On the second page it proceeds from connecting to the database first then saving the information to the database. After saving I used the javascript to tell the user that the information has been successfully saved then it will be rerouted to the firstpage again.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles