Code not working


#1

Notice : Undefined index: u_name in /storage/ssd4/877/8220877/public_html/unity game/unity game/create account user/create accouunt.php on line 12

Notice : Undefined index: u_pass in /storage/ssd4/877/8220877/public_html/unity game/unity game/create account user/create accouunt.php on line 13

Notice : Undefined index: u_email in /storage/ssd4/877/8220877/public_html/unity game/unity game/create account user/create accouunt.php on line 14

Notice : Undefined index: u_coin in /storage/ssd4/877/8220877/public_html/unity game/unity game/create account user/create accouunt.php on line 15

Notice : Undefined property: stdClass::$active in /storage/ssd4/877/8220877/public_html/unity game/unity game/create account user/create accouunt.php on line 25

What solved this problem, knowing that the code in another site was normal?


#2

Please paste the PHP script so we can help


#3
<?php $hostname="localhost"; $dbname="id8220877_gamethebest"; $dbuser="id8220877_mygame"; $dbpass="mesho"; $Dbconnect = mysql_connect($hostname,$dbuser,$dbpass) or die(mysqli_error()); $DbSelect= mysql_select_db($dbname) or die(mysqli_error()); $u_name= mysql_escape_string($_POST['u_name']); $u_pass=md5($_POST['u_pass']); $u_email=mysql_escape_string($_POST['u_email']); $u_coin=mysql_escape_string($_POST['u_coin']); $u_hash = mysql_escape_string(md5( rand(0,4))) ; $sqlquery=mysql_query("SELECT * FROM users")or die (mysql_error()); $fetchLqery=mysql_fetch_object($sqlquery); $email=$fetchLqery->u_email; $name=$fetchLqery->u_name; $pass=$fetchLqery->u_pass; $active=$fetchLqery->active; $u_coin=5000; if(empty($u_name) or empty ($u_pass) or empty($u_email)){ echo" Check data integrity "; }elseif(strlen($u_name)>20){ echo" Make sure the number of name is not greater than 20 characters "; } elseif($_POST['u_email'] == $email ){ echo" email has been taken "; }elseif($_POST['u_name'] == $name ){ echo" name has been taken "; }elseif($_POST['u_pass'] == $pass){ echo" pass has been taken "; }elseif($_POST['u_email'] == $email AND $_POST['u_name'] == $name AND $_POST['u_pass'] == $pass){ { echo" DATA has been taken "; } }else{ $DBadduser = mysql_query("INSERT INTO users (u_name,u_pass,u_email,u_hash,u_coin) VALUES ('$u_name','$u_pass','$u_email','$u_hash','$u_coin') ")or die (mysql_error()); echo"successfully plz check your email"; } ?>

#4

So, this means $_POST’s values are missing


#5

You mean, for example, the email is a blank box so failure of the code


#6

Yes, exactly, the email is not set


#7

why in local server code work and in another site i work by the code Because the program will write in variables


#8

ok thank you i will now why the code don’t work in the site


#9

The variables are not set, that’s the issue