can some one help me with this please;
Notice: Undefined index: username in P:\easyphp\www\Violet Registration Form\index.php on line 9
Notice: Undefined index: email in P:\easyphp\www\Violet Registration Form\index.php on line 10
Notice: Undefined index: password in P:\easyphp\www\Violet Registration Form\index.php on line 11
<?php $mysql_hostname = "localhost"; $mysql_user = "root"; $mysql_password = ""; $mysql_database = "johnXY"; $prefix = ""; $bd = mysql_connect($mysql_hostname, $mysql_user, $mysql_password) or die("Could not connect database"); mysql_select_db($mysql_database, $bd) or die("Could not select database"); $username=$_POST['username']; $email=$_POST['email']; $password=$_POST['password']; $query="INSERT INTO `member`(`username`, `email`, `password`)VALUES('".$username."', '".$email."', '".hash('sha256', $password)."')"; $data = mysql_query ($query)or die(mysql_error()); mysql_close(); ?>It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
In some cases, there wont be any POST data so it will be showing error. Use isset() function inside the if statement.
Make proper validation of every user input before using them. Like using isset empty function and checking proper datatype of the varible is recommend before inserting into database.