drop down list email

  • postonoh
  • Newbie
  • Newbie
  • postonoh
  • Posts: 5

Post 3+ Months Ago

I am very new I get one piece working now have problem with drop down list.


I have a drop down list.

Code: [ Select ]
<form action="/casinorsvp2.php" id="casino_us" method="post">
     <p align="left" class="label_name">How many are Attending?</p>
    <p align="left" class="input_form"><select name="attendee[]" width="5">
     <option value="1" >1</option>
     <option value="2" >2</option></select></p>
        <p align="left" class="label_name">Company </p>
        <p align="left" class="input_form">
         <input type="text" name="Company" />
         </p>
        <p align="left" class="label_name">Contact </p>
        <p align="left" class="input_form">
         <input type="text" name="Name" />
         </p>
        <p align="left" class="label_name">Email</p>
        <p align="left" class="input_form">
         <input type="text" name="Email" />
         </p>
        <p align="left" class="label_name">Address</p>
        <p align="left" class="input_form">
         <input type="text" name="Address" />
         </p>
        <p align="left" class="label_name">City</p>
        <p align="left" class="input_form">
         <input type="text" name="City" />
         </p>
        <p align="left" class="label_name">State</p>
        <p align="left" class="input_form">
         <input type="text" name="State" />
         </p>
        <p align="left" class="label_name">Zip Code</p>
        <p align="left" class="input_form">
         <input type="text" name="Zip_Code" />
         </p>
        <p align="left" class="label_name">Phone #</p>
        <p align="left" class="input_form">
         <input type="text" name="Phone_Number" />
         </p>
     <p align="left" class="label_name">I would like to enter the event via Flash Seats.</p>
     <p align="left" class="input_form">
     <select name="tickets" width="5">
     <option value="Yes">Yes</option>
     <option value="No">No</option></select></p>
        <p align="left" class="label_name">Select Certification(s) </p>
        <p align="left" class="input_form">
         <label>FBE </label>
         <input type="checkbox" name="ckboxGrp1[]" value="FBE" id="fbeBox" />
         <label>MBE </label>
         <input type="checkbox" name="ckboxGrp1[]" value="MBE" id="mbeBox" />
         <label>SBE </label>
         <input type="checkbox" name="ckboxGrp1[]" value="SBE" id="sbeBox" />
         <label>VA </label>
         <input type="checkbox" name="ckboxGrp1[]" value="VA" id="vaBox" />
         </p>
        <p></p>
        <p></p>
        <!--<p class="label_name">Message</p>
     <p class="input_form" id="textarea">
      <textarea name="Message" rows="5" cols="4" id="message_input"></textarea>
     </p>
     </p>-->
     
        <p align="left" id="submit">
         <input type="submit" value="Send" name="submitButton" class="button" />
         </p>
        </form>
  1. <form action="/casinorsvp2.php" id="casino_us" method="post">
  2.      <p align="left" class="label_name">How many are Attending?</p>
  3.     <p align="left" class="input_form"><select name="attendee[]" width="5">
  4.      <option value="1" >1</option>
  5.      <option value="2" >2</option></select></p>
  6.         <p align="left" class="label_name">Company </p>
  7.         <p align="left" class="input_form">
  8.          <input type="text" name="Company" />
  9.          </p>
  10.         <p align="left" class="label_name">Contact </p>
  11.         <p align="left" class="input_form">
  12.          <input type="text" name="Name" />
  13.          </p>
  14.         <p align="left" class="label_name">Email</p>
  15.         <p align="left" class="input_form">
  16.          <input type="text" name="Email" />
  17.          </p>
  18.         <p align="left" class="label_name">Address</p>
  19.         <p align="left" class="input_form">
  20.          <input type="text" name="Address" />
  21.          </p>
  22.         <p align="left" class="label_name">City</p>
  23.         <p align="left" class="input_form">
  24.          <input type="text" name="City" />
  25.          </p>
  26.         <p align="left" class="label_name">State</p>
  27.         <p align="left" class="input_form">
  28.          <input type="text" name="State" />
  29.          </p>
  30.         <p align="left" class="label_name">Zip Code</p>
  31.         <p align="left" class="input_form">
  32.          <input type="text" name="Zip_Code" />
  33.          </p>
  34.         <p align="left" class="label_name">Phone #</p>
  35.         <p align="left" class="input_form">
  36.          <input type="text" name="Phone_Number" />
  37.          </p>
  38.      <p align="left" class="label_name">I would like to enter the event via Flash Seats.</p>
  39.      <p align="left" class="input_form">
  40.      <select name="tickets" width="5">
  41.      <option value="Yes">Yes</option>
  42.      <option value="No">No</option></select></p>
  43.         <p align="left" class="label_name">Select Certification(s) </p>
  44.         <p align="left" class="input_form">
  45.          <label>FBE </label>
  46.          <input type="checkbox" name="ckboxGrp1[]" value="FBE" id="fbeBox" />
  47.          <label>MBE </label>
  48.          <input type="checkbox" name="ckboxGrp1[]" value="MBE" id="mbeBox" />
  49.          <label>SBE </label>
  50.          <input type="checkbox" name="ckboxGrp1[]" value="SBE" id="sbeBox" />
  51.          <label>VA </label>
  52.          <input type="checkbox" name="ckboxGrp1[]" value="VA" id="vaBox" />
  53.          </p>
  54.         <p></p>
  55.         <p></p>
  56.         <!--<p class="label_name">Message</p>
  57.      <p class="input_form" id="textarea">
  58.       <textarea name="Message" rows="5" cols="4" id="message_input"></textarea>
  59.      </p>
  60.      </p>-->
  61.      
  62.         <p align="left" id="submit">
  63.          <input type="submit" value="Send" name="submitButton" class="button" />
  64.          </p>
  65.         </form>


php code

Code: [ Select ]
$name = $_POST['Name'];
$email = $_POST['Email'];
$phone = $_POST['Phone_Number'];
$company = $_POST['Company'];
$address = $_POST['Address'];
$city= $_POST['City'];
$state = $_POST['State'];
$zip = $_POST['Zip_Code'];
$yes = $_POST['tickets'];
if (flashseed($yes) == "Yes")
if (isset($_POST['ckboxGrp1']))
{
    $_POST['ckboxGrp1'] = implode(', ', $_POST['ckboxGrp1']);
}
$checkbox = $_POST['ckboxGrp1'];
foreach ($checkbox as $chkbx)
{
    $checkbx .= "$chkbx\n";
}

$number = $_POST['attendee'];
foreach ($number as $num)
{
$ticket .= "$num\n";    
}

$body = <<<EOD
<br><hr><br>
Company: $company <br>
Name: $name <br>
Email: $email <br>
Phone: $phone <br>
Address: $address<br>
City: $city <br>
State: $state <br>
Postal Code: $zip <br>
Tickets: $yes <br>
Number: $ticket <br>
Certification: $checkbx <br>

EOD;
  1. $name = $_POST['Name'];
  2. $email = $_POST['Email'];
  3. $phone = $_POST['Phone_Number'];
  4. $company = $_POST['Company'];
  5. $address = $_POST['Address'];
  6. $city= $_POST['City'];
  7. $state = $_POST['State'];
  8. $zip = $_POST['Zip_Code'];
  9. $yes = $_POST['tickets'];
  10. if (flashseed($yes) == "Yes")
  11. if (isset($_POST['ckboxGrp1']))
  12. {
  13.     $_POST['ckboxGrp1'] = implode(', ', $_POST['ckboxGrp1']);
  14. }
  15. $checkbox = $_POST['ckboxGrp1'];
  16. foreach ($checkbox as $chkbx)
  17. {
  18.     $checkbx .= "$chkbx\n";
  19. }
  20. $number = $_POST['attendee'];
  21. foreach ($number as $num)
  22. {
  23. $ticket .= "$num\n";    
  24. }
  25. $body = <<<EOD
  26. <br><hr><br>
  27. Company: $company <br>
  28. Name: $name <br>
  29. Email: $email <br>
  30. Phone: $phone <br>
  31. Address: $address<br>
  32. City: $city <br>
  33. State: $state <br>
  34. Postal Code: $zip <br>
  35. Tickets: $yes <br>
  36. Number: $ticket <br>
  37. Certification: $checkbx <br>
  38. EOD;


Everthing shows up except for Number of attendees which is the drop down list

Please only reply with code and not a website reference.
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • ndeb
  • Newbie
  • Newbie
  • ndeb
  • Posts: 8

Post 3+ Months Ago

Try removing the [] after the attendee in line 3. It seems you are trying to use an array to get the value of the selected option but in getting your variable $number you are calling for attendee, not it's array ($_POST['attendee']).
I'd caution against leaving your variables unprotected like ($_POST)- it is a big security risk. Try protecting it with (mysql_real_escape_string($_POST[''])).
Hope this helps

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 61 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.