Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $host="l888888"; // Host name
- $username="******"; // Mysql username
- $password="t******"; // Mysql password
- $db_name="f****"; // Database name
- $tbl_name="m******"; // Table name
- // Connect to server and select databse.
- mysql_connect("$host", "$username", "$password")or die("cannot connect");
- mysql_select_db("$db_name")or die("cannot select DB");
- // username and password sent from form
- $myusername=$_POST['username'];
- mypassword=$_POST['password'];
- // To protect MySQL injection (more detail about MySQL injection)
- $myusername = stripslashes($myusername);
- $mypassword = stripslashes($mypassword);
- $myusername = mysql_real_escape_string($myusername);
- $mypassword = mysql_real_escape_string($mypassword);
- $query=mysql_query("INSERT INTO members(`username`,`password`) VALUES ('$myusername','$mypassword')");
- if($query)
- header('Location: /home/faltutal/public_html/treasurehunt/index.php');
- <?php
- $query=mysql_query("INSERT INTO members(`username`,`password`)
- VALUES('$myusername','$mypassword')");
- if($query)
- header('Location: http://my_ip/index.php.php?msg=added successfully');
- ?>
- <?php
- $query=mysql_query("INSERT INTO members(`username`,`password`)
- VALUES('$myusername','$mypassword')");
- if($query)
- echo "Successfully Added <a href='http://my_ip/index.php'>Click Here to Continue</a>";
- ?>
- <?php
- $query=mysql_query("INSERT INTO members(`username`,`password`)
- VALUES('$myusername','$mypassword')");
- if($query)
- header('Location: http://my_ip/mainpage.php.php');
- ?>
- if ($query) { // if it's true
- header('Location: http://yoursite.com/index.php');
- }
- <?php ob_start();
- $query=mysql_query("INSERT INTO members(`username`,`password`)
- VALUES('$myusername','$mypassword')");
- if($query)
- header('Location: http://my_ip/index.php.php?msg=added successfully');
- ob_end_flush(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement