help me to solve this error in php to store html input data | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

help me to solve this error in php to store html input data

Notice: Undefined variable: _Post in ^this type of error comes after using this post-> $_Post https://code.sololearn.com/wpP0YOsIakJ0/# ^php code https://code.sololearn.com/Wc5B50FOT3TQ/# ^html code https://pasteboard.co/ItB8IKV.png ^my error in code

20th Aug 2019, 5:47 PM
Yash🏁🔘
Yash🏁🔘 - avatar
2 Answers
+ 13
Yash🏁🔘 in php you need to take care of case used in variables as its case sensitive you should use $_POST in global variables. In storing database with php you need to first write the connection code. After writing the connection code you need to use this way <?php session_start(); error_reporting(0); include('includes/connect.php'); // Code user Registration if(isset($_POST['submit'])) { $name=$_POST['name']; $email=$_POST['email']; $password=md5($_POST['password']); $query=mysqli_query($con,"insert into users(name,email,password) values('$name','$email','$password')"); if($query) { echo "<script>alert('You are successfully register');</script>"; } else{ echo "<script>alert('Not register something went worng');</script>"; } } And in later part for login you can use $_SESSION variable and assign session to user. connection code <?php $con = mysql_connect("localhost","root",""); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("db_name", $con); ?>
20th Aug 2019, 6:11 PM
GAWEN STEASY
GAWEN STEASY - avatar
+ 3
GAWEN STEASY thanks 😃
21st Aug 2019, 1:51 AM
Yash🏁🔘
Yash🏁🔘 - avatar