php forms | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

php forms

help please with the php forms. My problem is that I understand the forms 1- when writing a second .php tag, it gives me a syntax error. 2-I can not understand what is on the second page (I mean the page is what is sent when filling out the forms.)

8th Apr 2019, 7:52 PM
Alvaro Blanco
Alvaro Blanco - avatar
5 Answers
0
Can you reference your code please?
8th Apr 2019, 8:02 PM
Victor Andersson
Victor Andersson - avatar
0
<html> <body> <form action = " ejercicio1.php " method = " post "> <p> Name: <input type = "text" name = "name" /> </p> <p> Edad: <input type = "text" name = "age" /> </p> <p> <input type = "submit" name = "submit" value = "Submit" / > </p> </form> </body>> </html> at the time of validating the other page, it shows me an error. 2-I have to save the page with the php extension, right?
8th Apr 2019, 8:04 PM
Alvaro Blanco
Alvaro Blanco - avatar
0
This is the name of my other page, exercise1.php, which is functional.
8th Apr 2019, 8:07 PM
Alvaro Blanco
Alvaro Blanco - avatar
0
Well that looks fine, do you have accompaning PHP? I wouldn’t put input tags inside paragraphs though. If you want containers use the div tag. The php file needs to have the php extension, yes. Any file which contains PHP code requires the .php extension. Is ”exercise1.php” the same as the one your trying to use inside your form action of ”ejercicio1.php”?
8th Apr 2019, 8:22 PM
Victor Andersson
Victor Andersson - avatar
0
I found the error The reason was that on the other page (.php), the variable that would receive the information entered by the user was not created. In this case, the variables $ age and $ name were. to solve it, create the two variables and then pass the post method. <? php $ age = $ _GET ["age"]; ?> youtube, help me. jjajajaj
9th Apr 2019, 3:35 PM
Alvaro Blanco
Alvaro Blanco - avatar