Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?include("database.php");?>
- <html>
- <head>
- <title>Home</title>
- <link rel = "Stylesheet" type = "text/css" href = "Style.css" />
- </head>
- <body>
- <div class = "header">
- <table class = "tableHeader">
- <tr>
- <th>
- <img src = "images/header.jpg" alt = "Header" align = "center"/>
- </th>
- </tr>
- </table>
- </div>
- <div class = "div1">
- <a href = "index.php">Home |</a>
- <a href = "Home.htm">| Login</a>
- </div>
- <div class = "div2">
- <a href = "products.php">Products|</a>
- <a href = "search.php">|Search|</a>
- <a href = "shopping_cart.php">|Shopping Cart|</a>
- <a href = "user_details.php">|User Details|</a>
- <a href = "registration.php">|Registration</a>
- </div>
- <h1>Registration</h1>
- <div class = "div3">
- <form action = "success.php" method = "post">
- <table class = "table1" cellspacing = "5px">
- <tr class = "tr_p">
- <th>User ID*:</th>
- <th><input type = "text" name = "user_id" id = "user_id" size = "20"/></th>
- <th> </th>
- </tr>
- <tr class = "tr_p">
- <th>Password*:</th>
- <th><input type = "password" name = "password" id = "password"/></th>
- <th> </th>
- </tr>
- <tr class = "tr_p">
- <th>Confirm password*:</th>
- <th><input type = "password" name = "password2" id = "password2"/></th>
- <th> </th>
- </tr>
- <tr class = "tr_p">
- <th>First Name*:</th>
- <th><input type = "text" name = "fname" id = "fname" <?$fname = $_POST['fname'];?>/></th>
- <th> </th>
- </tr>
- <tr class = "tr_p">
- <th>Last Name:</th>
- <th><input type = "text" name = "lname" id = "lname"/></th>
- <th> </th>
- </tr>
- <tr class = "tr_p">
- <th>Address*:</th>
- <th><input type = "text" name = "address" id = "address"/></th>
- <th> </th>
- </tr>
- <tr class = "tr_p">
- <th>City*:</th>
- <th><input type = "text" name = "city" id = "city"/></th>
- <th> </th>
- </tr>
- <tr class = "tr_p">
- <th>Zip Code*:</th>
- <th><input type = "text" maxlength = "5" name = "zipcode" id = "zipcode"/></th>
- <th style = "color:Red">Required</th>
- </tr>
- <tr class = "tr_p">
- <th>State*:</th>
- <th align = "center">
- <select name = "state" id = "state">
- <optgroup label = "state">
- <option></option>
- <option>PR</option>
- </optgroup>
- </select>
- </th>
- <th> </th>
- </tr>
- <tr class = "tr_p">
- <th>Email*:</th>
- <th><input type = "text" name = "email" id = "email"/></th>
- <th> </th>
- </tr>
- <tr class = "tr_p">
- <th>Phone Number*:</th>
- <th><input type = "text" maxlength = "10" name = "phone" id = "phone"/></th>
- <th> </th>
- </tr>
- </table>
- <input type = "submit" /><input type = "reset" />
- <?php
- $userid = $_POST['user_id'];
- $password = $_POST['password'];
- $fname = $_POST['fname'];
- $lname = $_POST['lname'];
- $address = $_POST['address'];
- $city = $_POST['city'];
- $zipcode = $_POST['zipcode'];
- $state = $_POST['state'];
- $email = $_POST['email'];
- $phone = $_POST['phone'];
- $db_servername = "localhost";
- $db_username = "root";
- $db_password = "";
- $db_name = "online_store";
- $db = mysql_connect($db_servername, $db_username, $db_password) or die("Could not connect to database");
- mysql_select_db($db_name);
- $query = "INSERT INTO online_store.customer('User_ID', 'Password', 'First_Name', 'Last_Name',
- 'Address', 'City', 'ZipCode', 'State', 'Email_Address', 'Phone_number)
- VALUES('$userid', '$password', $fname', '$lname', '$address',
- '$city', '$zipcode', '$state', '$email', '$phone');";
- mysql_query($insert) or die ('Error, could not update database');
- ?>
- </form>
- </div>
- <div class = "footer">
- <table class = "tableHeader">
- <tr>
- <th>
- <img src = "images/footer.jpg" alt = "Header" align = "center"/>
- </th>
- </tr>
- </table>
- </div>
- </body>
- </html>
Add Comment
Please, Sign In to add comment