when i register, it just reloads the page and does not update an account on my sql, could anyone help me with this please i could also send it on a note pad because i don’t know how to space it out on this website sorry
This is the top part of my page Register.php
<?PHP
include "heresmyconnect.php";
$datetime = gmdate('Y-m-d h:i:s');
indent preformatted text by 4 spaces
indent preformatted text by 4 spaces
function change($msg){
$post = $msg;
$post = str_replace(" ", "", $post);
return $post;
}
if ($_POST['Submit'] && change(strip_tags($_POST['username'])) && change(strip_tags($_POST['password']))){
$ip=$_SERVER['REMOTE_ADDR']; //draws IP address of visitor
$ref=mysql_real_escape_string(strip_tags($_GET['ref']));
//This of course tells the website that what follows
$realip=$_SERVER['REMOTE_ADDR'];
if (ereg('[^0-9]', $ref)){$ref="0";}
$email1 = $_POST['email'];
$email2 = change(mysql_real_escape_string($email1));
$email = ($email2);
$username1 = $_POST['username'];
$username2 = strip_tags($username1);
$username = change(mysql_real_escape_string($username2));
$password1 = $_POST['password'];
$password2 = strip_tags($password1);
$password = change(mysql_real_escape_string($password2));
$checkname = mysql_query("SELECT * FROM users WHERE username='$username'");
$NameCount = mysql_num_rows($checkname);
if ($NameCount > 0)
{
echo "<font color=red>The username is already in use, Please choose another!</font>";
}else{
$result = mysql_query("SELECT * FROM registerip") or die("Hack protection error Please contact [email protected] and tell him about this!");
// keeps getting the next row until there are no more to get
while($row = mysql_fetch_array( $result )) {
$id = $row['id'];
$timeleft = $row['time'] - time();
if ($timeleft <0){mysql_query("DELETE FROM registerip WHERE id='$id'");}
}// while loop
$rresult = mysql_query("SELECT * FROM registerip WHERE ip='$realip'");
$rrow = mysql_num_rows($rresult);
if($rrow >= "2"){
die("your ip has registered a account a little while a go, Please wait before you can register another!");
}
if (ereg('[^A-Za-z0-9]', $username)) {echo "<font color=white>Your username can only contain A-Z,a-z and 0-9.</font>";}else{
$randompin129 = rand(1,54785412);
$otime=time();
mysql_query("INSERT INTO `users` ( `id` , `username` , `password` , `email` ,`ip`,`referedby`,`pin`) VALUES ('', '$username', '$password', '$email', '$ip', '$ref', '$randompin129')");
mysql_query("INSERT INTO `times` ( `username` ) VALUES ('$username')");
mysql_query("INSERT INTO `messages` ( `id` , `t` , `f` , `message` , `date` , `r` , `saved` ) VALUES (
'', '$username', 'Natasha', 'HEY <br> Do me a faviour, Kill Tyler for me, he is chatting shit about me<br>If you kill him you will be paid nicely ;)</b>', '$date', '0', '0')");
mysql_query("INSERT INTO `messages` ( `id` , `t` , `f` , `message` , `date` , `r` , `saved` ) VALUES (
'', '$username', 'MrSecret', 'Your password Recovery Pin is $randompin129 Please remember this, incase you forget your password. You can change this by going into the profile section.', '$date', '0', '0')");
$sql = "INSERT INTO registerip SET id = '', ip = '$realip', time = '".strtotime ("+10 minutes")."'";
$res = mysql_query($sql);
// Automatically collects the hostname or domain like example.com)
$host = $_SERVER['HTTP_HOST'];
$host_upper = strtoupper($host);
$path = rtrim(dirname($_SERVER['PHP_SELF']), '/\\');
Admin Edit: Added Code tags