...

View Full Version : PHP Mail to form



Foster
11-10-2011, 10:28 PM
I'm in need of help i have a page where a user needs to select 1 (or more) items from a list, enter their name then send the information to myself. I seem to be having a problemwith the information going through. if any one can help me please PM me

myfayt
11-10-2011, 10:36 PM
You would need to post the coding for us to be able to help. :thumbsup:

Foster
11-11-2011, 09:12 AM
<form action="send_contact.php" method="post">

<input type="hidden" name="_submit_check" value="1"/>
</td>
<center>
<table width="98%" border="0" cellpadding="3" cellspacing="1" bgcolor="">
<tr>
<td bgcolor=""><font>&nbsp;</td>
<td bgcolor=""><font><nobr>Weapon Name</nobr></font></td>
<td bgcolor=""><font>Description</font></td>
<td bgcolor=""><font>Price</font></td>
<tr><td bgcolor="" valign="top"><font size="1" face="Verdana"><input type="radio" name="Weapons" value="Brass Knuckles"></td><td bgcolor="" valign="top"><font size="1" face="Verdana">Brass Knuckles</td><td bgcolor="" width="90%"><font size="1" face="Verdana"><strong>DMG</strong>: +5<BR><strong>Special</strong>: None<BR><strong>Restrictions:</strong>: None<BR>Want to pack a bit more in your punch? This finely crafted brass piece fits over the knuckles with a brace fitting into your palm. Perfect for gaining the upper hand in a fist fight.</td><td bgcolor="" valign="top"><font size="1" face="Verdana"><input type="hidden" name="Cost" value="$125">$125</font></td></tr><tr><td bgcolor="" valign="top"><font size="1" face="Verdana"><input type="radio" name="Weapons" value="Spurs"></td><td bgcolor="" valign="top"><font size="1" face="Verdana">Spurs</td><td bgcolor="" width="90%"><font size="1" face="Verdana"><strong>DMG</strong>: +5<BR><strong>Special</strong>: Kicks only.<BR><strong>Restrictions:</strong>: None<BR>A pair of spurs to put on the heels of boots. Most of the time they're sharpened to add in a cut to the initial 'heel to the face' manuever. Just dont try riding a horse with a pair of the sharpened ones.</td><td bgcolor="" valign="top"><font size="1" face="Verdana"><input type="hidden" name="Cost" value="$125">$125</font></td></tr><tr><td bgcolor="" valign="top"><font size="1" face="Verdana"><input type="radio" name="Weapons" value="Knife Boots"></td><td bgcolor="" valign="top"><font size="1" face="Verdana">Knife Boots</td><td bgcolor="" width="90%"><font size="1" face="Verdana"><strong>DMG</strong>: +15<BR><strong>Special</strong>: Kicks only.<BR><strong>Restrictions:</strong>: None<BR>A pair of boots with retractable knives in them. Made for those who prefer to put Boot-to-*** instead of Fist-to-Face.</td><td bgcolor="" valign="top"><font size="1" face="Verdana"><input type="hidden" name="Cost" value="$250">$250</font></td></tr><tr><td bgcolor="" valign="top"><font size="1" face="Verdana"><input type="radio" name="Weapons" value="Spiked Gloves"></td><td bgcolor="" valign="top"><font size="1" face="Verdana">Spiked Gloves</td><td bgcolor="" width="90%"><font size="1" face="Verdana"><strong>DMG</strong>: +15<BR><strong>Special</strong>: Can use gloves to scale walls, rocks.<BR><strong>Restrictions</strong>: 25 Strength to climb walls<BR>Not just badass biker gear, the gauntlet-like metal plates sewn into the upper fingers and knuckles of these gloves act as a brace for the half-inch spikes protruding from the leather.</td><td bgcolor="" valign="top"><font size="1" face="Verdana"><input type="hidden" name="Cost" value="$350">$350</font></td></tr><tr><td bgcolor="" valign="top"><font size="1" face="Verdana"><input type="radio" name="Weapons" value="Power Fist"></td><td bgcolor="" valign="top"><font size="1" face="Verdana">Power Fist</td><td bgcolor="" width="90%"><font size="1" face="Verdana"><strong>DMG</strong>: +25<BR><strong>Special</strong>: None<BR><strong>Restrictions:</strong>: Requires small energy cells.<BR>A mechanical glove that fits over both hands, the Power Fist is a mighty weapon for those who rely on their fists. Power by energy cells, the Power Fist makes a small explosion every punch by firing an energy cell out. </td><td bgcolor="" valign="top"><font size="1" face="Verdana"><input type="hidden" name="Cost" value="$600">$600</font></td></tr><tr><tr><td></td><td width="20%"><font> Name:&nbsp;&nbsp;&nbsp;</td><td width="80%"><INPUT TYPE="text" name="name" size="50%" value=""><td bgcolor="" colspan="5" align="right"><input type="submit" name="update" value="BUY" /></tr></table><font size="1" face="Verdana"></form><BR><BR></td></tr></table>

that is the code for the site, i have no idea when it comes to the php side of this. not all of the radio buttons need to be sent in the email just the one that is ticked

Foster
11-11-2011, 10:56 AM
this is the send_contact.php


<?php
$to = "streetracerstyling@hotmail.com";
$subject = "Weapon Purchase";

$name = $_POST['name'] ;
$Weapons = $_POST['Weapons'] ;

?>

myfayt
11-11-2011, 02:14 PM
You'd need this to extract the button value of which is selected.


$selected_radio = $_POST['weapon'];

Change weapon to the radio button name. Make all of them the same name.

alemcherry
11-11-2011, 03:28 PM
Only one radio button can be selected at a time, so $Weapons = $_POST['Weapons'] ; will be the value of radio button selected. If in any doubt print_r($_POST) and see.

I recommend you read up the PHP basics, this is fundamental question, not something you would ask help for.

tangoforce
11-11-2011, 04:03 PM
I recommend you read up the PHP basics, this is fundamental question, not something you would ask help for.

I have a php book and that never explained how to deal with radio buttons and checkboxes so I'm afraid I must suggest something to you:

Don't tell people not to ask for help. Not everyone understands these things and this forum exists specifically to help people with technical issues in their code :thumbsup:

If someone was asking you to write their entire website code from scratch you'd have grounds to suggest they go away but asking a technical question about how to do something in PHP is what we're here for.

That is a fundamental issue that YOU should understand. Not one you should need explaining to you :rolleyes: :cool:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum