+ 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
2 RĂ©ponses
+ 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);
?>
+ 3
GAWEN STEASY thanks đ