Click here to Skip to main content
15,896,111 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have information in this code
HTML
<form action="action_page.php">


First name:<br>
<input type="text" name="firstname" value="Mickey">
<br>
Last name:<br>
<input type="text" name="lastname" value="Mouse">
<br><br>

<input type="radio" name="sex" value="male" checked>Male
<br>
<input type="radio" name="sex" value="female">Female
<br><br>
<input type="checkbox" name="vehicle" value="Bike">I have a bike
<br>
<input type="checkbox" name="vehicle" value="Car">I have a car 
<br><br>

<input type="submit" value="Submit">
</form>


I need code when click on submit send these information to page of php and before this check if any of this field not checked in this case return message like "please fill all options " how can do this
Posted
Comments
Mohibur Rashid 8-Mar-15 22:03pm    
Well, first learn about method used by HTML. And also read about PHP a little more. I have a feelings that you have read nothing about php.

Do you know about get/post? Nothing specifically to PHP.
 
Share this answer
 
Comments
neveen neveen 9-Mar-15 9:14am    
yes I know, but I don't know how can using (get/post) to solve my problem
CodingLover 9-Mar-15 12:13pm    
Read the following

http://www.w3schools.com/php/php_forms.asp
 
Share this answer
 
v2
Comments
neveen neveen 11-Mar-15 13:49pm    
@Peter Leow,I use this code <form action="welcome.php" method="post"> put when run the server(localhost) I have this error "The HTTP verb POST used to access path '/WebSite3/first.php' is not allowed."
Peter Leow 11-Mar-15 21:46pm    
Are you using html as extension, then change it to php.
neveen neveen 12-Mar-15 17:27pm    
How can do this? please

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900