Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis+ 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>
5 Respostas
+ 8
Ayah K Alrifai yes, to run PHP on your computer you need a local host/server. Check these out :
https://stackoverflow.com/questions/8580273/how-to-run-php-files-on-my-computer
https://www.phpknowhow.com/basics/running-php-files/
https://www.techwalla.com/articles/how-to-run-a-php-file-in-xampp
+ 6
Do you have a local host like XAMPP installed on your computer?
+ 1
Chee-Oma thank you š¹š¹
+ 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.
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 !!?