ISN (International Social Networking Services - Interactive Apps and Websites)

Adding a User - PHP Script


$self = $_SERVER['PHP_SELF'];
$firstname = $_POST['firstname'];
$lastname = $_POST['lastname'];
$username = $_POST['username'];
$password = $_POST['password'];

if( (!$firstnameor (!$lastnameor (!$usernameor (!$password) )
  $form ="Please enter all new user details...";
  $form.="<form action=\"$self\"";
  $form.=" method=\"post\">First Name: ";
  $form.="<input type=\"text\" name=\"firstname\"";
  $form.=" value=\"$firstname\"><br>Last Name: ";
  $form.="<input type=\"text\" name=\"lastname\"";
  $form.=" value=\"$lastname\"><br>User Name: ";
  $form.="<input type=\"text\" name=\"username\"";
  $form.=" value=\"$username\"><br>Password: &nbsp; ";
  $form.="<input type=\"text\" name=\"password\"";
  $form.=" value=\"$password\"><br>";
  $form.="<input type=\"submit\" value=\"Submit\">";
  $conn = @mysql_connect("localhost","root"""or die("Could not connect to MySQL");
  $db = @mysql_select_db("my_database",$connor die("Could not select database");
  $sql = "insert into users (first_name,last_name,user_name,password)values (\"$firstname\",\"$lastname\",\"$username\",password(\"$password\") )";
  $result = @mysql_query($sql,$conn)or die("Could not execute query");
    echo("New user $username added")

By continuing to use this site, you agree to the use of cookies to personalize content and advertisements, to provide social media functionality, to analyze our traffic using Google services like Analytics and Adsense.

Google Adsense and its partners may use your data for advertising personalization and cookies may be used for personalized and non-personalized advertising. How does Google use my data?
Please use the following button to see the list of Google partners as well as all the details regarding cookies.
See detailsI Accept
These cookies are mandatory for the operation of, if you do not accept them please quit this site.
You have the right to refuse cookies and leave the site or to change the parameters.