+ 1

Hello everyone ,,there are any constraints to run php code in chrome ?

I have 2 file ,first one main.html have a form and second one welcome.php to print data fields after submit,when click in submit it is install welcome.php!!! Why?? _______________main.html________________ <html> <body> <form action="welcome.php" method="post"> Name: <input type="text" name="name"><br> E-mail: <input type="text" name="email"><br> <input type="submit"> </form> </body> </html> _____________welcome.php_______________ <html> <body> Welcome <?php echo $_POST["name"]; ?><br> Your email address is: <?php echo $_POST["email"]; ?> </body> </html>

9th Sep 2019, 10:43 AM
Ayah K Alrifai
Ayah K Alrifai - avatar
5 Respuestas
+ 6
Do you have a local host like XAMPP installed on your computer?
9th Sep 2019, 11:28 AM
Oma
Oma - avatar
+ 1
Chee-Oma thank you 🌹🌹
9th Sep 2019, 11:51 AM
Ayah K Alrifai
Ayah K Alrifai - avatar
+ 1
Php is server script, it cannot run directly by openning the local php file alone. If your machine os is Windows, you could install local server tool such as XAMPP to form a local php server on your machine first, which allow local browser to open php from C:\xampp\htdocs folder or run php -S index.php cmd to run index.php php file from other folder.
9th Sep 2019, 12:20 PM
Calviղ
Calviղ - avatar
0
Chee-Oma no , i am beginner in php and i am write codes in this app before learn forms ,i need to download local host in my computer !!?
9th Sep 2019, 11:36 AM
Ayah K Alrifai
Ayah K Alrifai - avatar