+ 6
Anyone have idea how to connect my html form login detailed to my sql database ?
I have used My phone as database I download bit web server ....
7 odpowiedzi
0
I made some adjustments to your script. Make sure you close statements with brackets and close all quotations
<?php
$servername="localhost";
$dbusername="root";
$dbpassword="";
$dbname="youtube";
$user= $_POST('user');
$pass= $_POST('pass');
$conn= new mysqli($servername, $dbusername,$dbpassword, $dbname);
if($conn->conn_error) {
die("connection failed" . $conn->connect_error);
}
if(empty($user)) {
echo "user field cannot be empty" ;
die();
}
?>
+ 3
this is my php coding
it is right or wrong
https://code.sololearn.com/wvT5QRqrCZdg/?ref=app
+ 3
now how I connect to my html coding with this is php coding in sololearn
+ 2
You will need to use PHP for a login script. Take a look at this at my example
https://code.sololearn.com/ww6MFJwzQWzu/?ref=app
0
Now that is just the basic script. You will need to implement the use of sessions
0
I don't think you can in sololearn. But you'll name it login.php and then in your html, make the action=login.php and the method=POST
0
You could just put your html code in the php script.