Location: PHPKode > scripts > Private address book > private-address-book/add.php
<?php
include('database.php');

if($_POST['action'])
{
  $name=$_POST['name'];
  $surname=$_POST['surname'];
  $nickname=$_POST['nickname'];
  $address=$_POST['address'];
  $number=$_POST['number'];
  $email=$_POST['email'];
  $info=$_POST['info'];
  
  $query="INSERT INTO users (id, name, surname, nickname, address, number, email, info) VALUES (NULL, '$name', '$surname', '$nickname', '$address', '$number', '$email', '$info')";
  $rez=mysql_query($query);
  }
?> 
<style type="text/css">
<!--
form {  font-family: "Courier New", Courier, mono; background-color: #0099FF}
body {  font-family: "Times New Roman", Times, serif; background-color: #00FFFF}
-->
</style>


<form action="<?php echo $_SERVER['php_self'] ?>" method="post">
Name<br><input type="text" name="name"><br />
Surname<br><input type="text" name="surname"><br />
Nickname<br><input type="text" name="nickname"><br />
Address<br><input type="text" name="address"><br />
Number<br><input type="text" name="number"><br />
Email<br><input type="text" name="email"><br />
Info<br><textarea cols = 15 rows = 5 name=info></textarea><br />
<br><input type="submit" name="action" value="Send!">
</form>
<a href="list.php">Address lists</a>
<a href="search.php">Search</a>




Return current item: Private address book