My PHP form is not working... | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

My PHP form is not working...

I made a form in html and set the action to a php file(the one below) and every time I click submit instead of actually doing what I programmed it literally takes me to the php document where all the code is, like below which is my code: <?php $name = (int)$_POST["name"]; echo"$name"; $email = (int)$_POST["email"]; echo"$email"; $message = (int)$_POST["message"]; echo"$message"; ?>

15th Jun 2018, 1:42 AM
Kyle
Kyle - avatar
8 Answers
+ 2
Oh it means it’s not executing it and you should check your apache installation. You may need to enable php. Depends on what you are using. You may need to install php separately.
15th Jun 2018, 2:06 AM
Toni Isotalo
Toni Isotalo - avatar
+ 1
It should take you to the page ...
15th Jun 2018, 2:03 AM
Toni Isotalo
Toni Isotalo - avatar
+ 1
okay thanks!
15th Jun 2018, 2:29 AM
Kyle
Kyle - avatar
0
no but instead of showing the user all my code it should just show the “echo “$name”;” for example
15th Jun 2018, 2:05 AM
Kyle
Kyle - avatar
0
oh okay I probably installed the wrong php package for vscode.. Do you know what i have to install? I have a mac?
15th Jun 2018, 2:07 AM
Kyle
Kyle - avatar
0
try echo without quotes "
15th Jun 2018, 2:20 AM
Hemath Kumar
Hemath Kumar - avatar
0
okay ill try that but i think i may have installed php wrong
15th Jun 2018, 2:27 AM
Kyle
Kyle - avatar
0
just go with YouTube and search which is good for your mac
15th Jun 2018, 2:28 AM
Hemath Kumar
Hemath Kumar - avatar