简体   繁体   中英

Submit form php adding radio buttons

Good morning, I have a submit form,s code and it works perfectly. But when i add more inputs or radio buttons it stops working. I'm a front-end developer and i'm not very good at back-end development. Can anybody please help me to sort it out. Thanks

 <html> <head></head> <body> <form action="invia.php" method="POST"> Nome: <input type="text" name="nome"> <br><br> Email: <input type="email" name="email"> <br><br> Messaggio: <br> <textarea name="message" rows="10" cols="50" ></textarea> <br><br> <input type="submit" value="Invia"> </form> </body> </html>

 <?php $client = $_POST['nome']; $email = $_POST['email']; $message = $_POST['message']; mail("someone@gmail.com","Contact from the site",$message,"From: $email\\r\\n"); ?>

If we say we have this:

<input type="radio" name="gender" value="male"> Male<br>
<input type="radio" name="gender" value="female"> Female<br>

Then only the last value will be taken because names overlap each other.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM