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 piotr  >  Register User  >  example_register.php  >  Download  
File: example_register.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Register User
Create registered user records in a MySQL table
Author: By
Last change: require_once
Date: 8 years ago
Size: 2,245 bytes
 

Contents

Class file image Download
<?php

    
if( empty($_POST['login']) || empty($_POST['password']) || empty($_POST['first']) ||
    empty(
$_POST['last']) || empty($_POST['address']) || empty($_POST['zip']) || empty($_POST['city'])
    || empty(
$_POST['age']) || empty($_POST['sex']) || empty($_POST['phone']) || empty($_POST['email'])) {

    echo (
"Please enter the correct information");
    
    }
    
    else {
        require_once(
"class_register.php");
        
$obj = new Register();
        
$obj->AddUser($_POST['login'], $_POST['password'], $_POST['first'], $_POST['last'],
        
$_POST['address'], $_POST['zip'], $_POST['city'], $_POST['age'], $_POST['sex'], $_POST['phone'], $_POST['email']);

    }
?>

<html>
<head>
<title>Register</title>
</head>

<body>

<form method="post" action="">

<table width="500" cellpadding="0" cellspacing="0" align="left">
    <tbody>
        <tr>
            <td>
            <p>Login:</p>
            <input name="login" type="text" style="width:348">
            </td>
        </tr>
        <tr>
            <td>
            <p>Password:</p>
            <input name="password" type="password" style="width:348">
            </td>
        </tr>
        <tr>
            <td>
            <p>First name:</p>
            <input name="first" type="text" style="width:348">
            </td>
        </tr>
        <tr>
            <td>
            <p>Last name:</p>
            <input name="last" type="text" style="width:348">
            </td>
        </tr>
        <tr>
            <td>
            <p>Street address:</p>
            <input name="address" type="text" style="width:348">
            </td>
        </tr>
        <tr>
            <td>
            <p>Zip:</p>
            <input name="zip" type="text" style="width:348">
            </td>
        </tr>
        <tr>
            <td>
            <p>City:</p>
            <input name="city" type="text" style="width:348">
            </td>
        </tr>
        <tr>
            <td>
            <p>Age:</p>
            <input name="age" type="text" style="width:348">
            </td>
        </tr>
        <tr>
            <td>
            <p>Sex:</p>
            <select name="sex">
            <option value="male">male</option>
            <option value="female">female</option>
            </td>
        </tr>
        <tr>
            <td>
            <p>Phone:</p>
            <input name="phone" type="text" style="width:348">
            </td>
        </tr>
        <tr>
            <td>
            <p>E-mail:</p>
            <input name="email" type="text" style="width:348">
            </td>
        </tr>
        <tr>
            <td>
            <input type="submit" value="Register" class="short" style="width:55px">
            </td>
        </tr>
    </tbody>
</table>

</body>
</html>