0
how do I run a php file after html form submission
I have been trying to run a php file after the submission of an html form. i have been using the action attribute but it just shows the code instead of running it. thank you in advance
2 Antworten
+ 5
Conrad
Before running php file you need to connect your database from your html page so that the data can be fetched and sent from form and stored in the database
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
And in later part for login you can use $_SESSION variable and assign session to user.
connection code is written in this way
<?php
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("db_name", $con);
?>
https://code.sololearn.com/wNJIukAbu15e/?ref=app
https://code.sololearn.com/wL1nTD46BZuX/?ref=app
- 1
Thanks for the explanation! You Rock! ;)