Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    Regular Coder
    Join Date
    Nov 2011
    Posts
    250
    Thanks
    8
    Thanked 4 Times in 4 Posts

    PHP Mail to form

    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

  • #2
    Senior Coder
    Join Date
    Apr 2010
    Posts
    1,419
    Thanks
    68
    Thanked 102 Times in 101 Posts
    You would need to post the coding for us to be able to help.
    Been a sign maker for 7 years. My business:
    American Made Signs

  • #3
    Regular Coder
    Join Date
    Nov 2011
    Posts
    250
    Thanks
    8
    Thanked 4 Times in 4 Posts
    <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

  • #4
    Regular Coder
    Join Date
    Nov 2011
    Posts
    250
    Thanks
    8
    Thanked 4 Times in 4 Posts
    this is the send_contact.php

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

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

    ?>

  • #5
    Senior Coder
    Join Date
    Apr 2010
    Posts
    1,419
    Thanks
    68
    Thanked 102 Times in 101 Posts
    You'd need this to extract the button value of which is selected.

    PHP Code:
    $selected_radio $_POST['weapon']; 
    Change weapon to the radio button name. Make all of them the same name.
    Been a sign maker for 7 years. My business:
    American Made Signs

  • #6
    New Coder
    Join Date
    Apr 2010
    Posts
    55
    Thanks
    0
    Thanked 4 Times in 4 Posts
    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.
    Hosting Reviews and Discounts: Bluehost Coupon and Hostmonster Coupon

  • #7
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,313
    Thanks
    58
    Thanked 525 Times in 512 Posts
    Blog Entries
    5
    Quote Originally Posted by alemcherry View Post
    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

    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
    See my new CodingForums Blog: http://www.codingforums.com/blogs/tangoforce/

    Many useful explanations and tips including: Cannot modify headers - already sent, The IE if (isset($_POST['submit'])) bug explained, unexpected T_CONSTANT_ENCAPSED_STRING, debugging tips and much more!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •