Login   Register  
PHP Classes
elePHPant
Icontem

File: example_register.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of norayrx  >  user_registration_module  >  example_register.php  >  Download  
File: example_register.php
Role: Example script
Content type: text/plain
Description: example_register
Class: user_registration_module
Register users with records in a MySQL database
Author: By
Last change:
Date: 2009-01-16 03:01
Size: 2,773 bytes
 

Contents

Class file image Download
<?php
include_once("config.php");
include_once(
"class_register.php");
include_once(
"class_db_connect.php");


if(!empty(
$_POST['submit_register']))
     {
        if( empty(
$_POST['username']) || empty($_POST['password']) || empty($_POST['firstname']) ||
        empty(
$_POST['lastname']) || empty($_POST['street_address']) || empty($_POST['zipcode']) || empty($_POST['country'])
        || empty(
$_POST['age']) || empty($_POST['gender']) || empty($_POST['phone']) || empty($_POST['email'])) {

        print 
$MSG_ERROR_REGISTER "Please enter the correct information<br>";

        }

        else {
            include_once(
"class_register.php");
            
$obj = new Register();
            
$obj->AddUser($_POST['username'], $_POST['password'], $_POST['firstname'], $_POST['lastname'],
            
$_POST['street_address'], $_POST['zipcode'], $_POST['country'],$_POST['city'], $_POST['age'], $_POST['gender'], $_POST['phone'], $_POST['email']);

        }
     }


?>


<fieldset style="width:410px;"><legend>USER REGISTRATION</legend>
<form action="" method="post">
<table align="center" width="400" border="1" width="381" cellspacing="0" cellpadding="5">
  <tr>
    <td width="181">USERNAME:</td>
    <td width="174"><input name="username" type="text" maxlength="20" value=""></td>
  </tr>
  <tr>
    <td>PASSWORD:</td>
    <td><input name="password" type="password" maxlength="20" value=""></td>
  </tr>
  <tr>
    <td>CONFIRM_PASSWORD:</td>
    <td><input name="username" type="confpassword" maxlength="20" value=""></td>
  </tr>
  <tr>
     <td>FIRSTNAME</td><td><input name="firstname" maxlength="50" /></td>
  </tr>
  <tr>
     <td>LASTNAME</td><td><input name="lastname" maxlength="50" /></td>
  </tr>
    <td>Birt Date:</td>
    <td><input name="age" type="text" maxlength="20" value=""></td>
  </tr>
  <tr>
    <td>GENDER</td>
    <td><input name="gender" type="radio" value="m"><input name="gender" type="radio" value="f"></td>
  </tr>
  <tr>
    <td>STREET_ADDRESS</td><td><input name="street_address" maxlength="50" /></td>
  </tr>
  <tr>
    <td>COUNTRY</td>
    <td><input name="country" type="text" maxlength="20" value=""></td>
  </tr>
    <tr>
    <td>CITY</td>
    <td><input name="city" type="text" maxlength="20" value=""></td>
  </tr>
  <tr>
    <td>ZIP CODE</td>
    <td><input name="zipcode" type="text" maxlength="20" value=""></td>
  </tr>
   <tr>
    <td>PHONE</td>
    <td><input name="phone" type="text" maxlength="20" value=""></td>
  </tr>
  <tr>
    <td>EMAIL</td>
    <td><input name="email" type="text" maxlength="20" value=""></td>
  </tr>
  <tr>
    <td></td>
    <td><input name="submit_register" type="submit" maxlength="20" value="REGISTR"></td>
  </tr>
</table>
</form>
</fieldset>