+ 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 ....

2nd Aug 2017, 11:03 AM
Faizan Shaikh
Faizan Shaikh - avatar
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(); } ?>
2nd Aug 2017, 2:32 PM
Corey
Corey - avatar
+ 3
this is my php coding it is right or wrong https://code.sololearn.com/wvT5QRqrCZdg/?ref=app
2nd Aug 2017, 2:11 PM
Faizan Shaikh
Faizan Shaikh - avatar
+ 3
now how I connect to my html coding with this is php coding in sololearn
2nd Aug 2017, 2:13 PM
Faizan Shaikh
Faizan Shaikh - avatar
+ 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
2nd Aug 2017, 1:35 PM
Corey
Corey - avatar
0
Now that is just the basic script. You will need to implement the use of sessions
2nd Aug 2017, 1:37 PM
Corey
Corey - avatar
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
2nd Aug 2017, 2:23 PM
Corey
Corey - avatar
0
You could just put your html code in the php script.
2nd Aug 2017, 2:29 PM
Corey
Corey - avatar