Note that there are some explanatory texts on larger screens.

plurals
  1. POImplode Issue On PHP Form
    primarykey
    data
    text
    <p>In spite of the fact that I'll probably look like a complete idiot, I'm going to post my entire files to see what I'm doing wrong. </p> <p>I have form built into the page like so:</p> <pre><code>&lt;form method="post" class="form-horizontal" id="final_form" action="send_mail.php"&gt; &lt;h2&gt;Search for your dream home&lt;br /&gt; and save now!&lt;/h2&gt; &lt;legend&gt;Which Areas are you interested in?&lt;/legend&gt; &lt;div class="areas row-fluid" style="text-align:left !important;"&gt; &lt;div class='span5' style='margin-left:0px !important;'&gt; &lt;label&gt; &lt;input type="checkbox" name="arrayValue[]" id="area[0]" value="Sparks" style='margin-top:-5px !important;'&gt; Sparks&lt;/label&gt; &lt;/div&gt; &lt;div class='span5' style='margin-left:0px !important;'&gt; &lt;label &gt; &lt;input type="checkbox" name="arrayValue[]" id="area[1]" value="Stead" style='margin-top:-5px !important;'&gt; Stead&lt;/label&gt; &lt;/div&gt; &lt;div class='span5' style='margin-left:0px !important;'&gt; &lt;label&gt; &lt;input type="checkbox" name="arrayValue[]" id="area[2]" value="North Reno" style='margin-top:-5px !important;'&gt; North Reno&lt;/label&gt; &lt;/div&gt; &lt;div class='span5' style='margin-left:0px !important;'&gt; &lt;label &gt; &lt;input type="checkbox" name="arrayValue[]" id="area[3]" value="South Reno" style='margin-top:-5px !important;'&gt; South Reno&lt;/label&gt; &lt;/div&gt; &lt;div class='span5' style='margin-left:0px !important;'&gt; &lt;label &gt; &lt;input type="checkbox" name="arrayValue[]" id="area[4]" value="Double Diamond" style='margin-top:-5px !important;'&gt; Double Diamond&lt;/label&gt; &lt;/div&gt; &lt;/div&gt; &lt;input type="button" onclick="jQuery('#myModal').modal('show')" value="CONTINUE" /&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;!--banner area end--&gt; &lt;!--content area 1 start--&gt; &lt;div id="content1"&gt; &lt;div class="content1_in"&gt; &lt;span&gt; &lt;h2 style="line-height:40px;font-size:40px;padding-bottom:10px"&gt;Some Content&lt;/h2&gt; &lt;p style="line-height:30px;font-size:22px;text-align: left"&gt;Some Content!&lt;/p&gt; &lt;/span&gt; &lt;div class="img"&gt; &lt;img src="image" alt="" /&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;!--content area 1 end--&gt; &lt;!--content area 1 start--&gt; &lt;div id="content2"&gt; &lt;div class="content2_in"&gt; &lt;span&gt; &lt;/span&gt; &lt;div class="img"&gt; &lt;img src="http://f14.co/realtor/assets/images/ipad-img.png" alt="" /&gt; &lt;div class="key"&gt;&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;!--content area 1 end--&gt; &lt;!--content area 3 start--&gt; &lt;div id="content3"&gt; &lt;div class="content3_in"&gt; &lt;div class="img"&gt; &lt;img src="image" alt="" /&gt; &lt;/div&gt; &lt;div class="free"&gt;&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;!--content area 3 end--&gt; &lt;div id="footer"&gt; &lt;div class="footer_in"&gt; This Website Is Brought To You By: Ken Holden&lt;/div&gt; &lt;/div&gt; &lt;!-- Modal --&gt; &lt;div id="myModal" class="modal hide fade modal-survey" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"&gt; &lt;div class="modal-header"&gt; &lt;button type="button" class="close" data-dismiss="modal" aria-hidden="true"&gt;x&lt;/button&gt; &lt;h3 id="myModalLabel" class="survey_title"&gt;What type of home are you looking for?&lt;/h3&gt; &lt;/div&gt; &lt;input type="hidden" name="template" id="template" value="Buyers" /&gt; &lt;div class="modal-body"&gt; &lt;div id="lead_info_1"&gt; &lt;div class="input select"&gt; &lt;div class=""&gt;&lt;/div&gt; &lt;div class="span-4 step-2-dropdown append-bottom control-group"&gt; &lt;select class="span3 required" name="minPrice" id="minPrice"&gt; &lt;option value=""&gt;Price&lt;/option&gt; &lt;option value='$50,000 - $150000'&gt;$50,000 - $150000&lt;/option&gt;&lt;option value='$150,000 - $300,000'&gt;$150,000 - $300,000&lt;/option&gt;&lt;option value='$300,000 - $400,000'&gt; $300,000 - $400,000&lt;/option&gt;&lt;option value='$400,000 +'&gt;$400,000 +&lt;/option&gt; &lt;/select&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="input select"&gt; &lt;div class=""&gt;&lt;/div&gt; &lt;div class="span-4 step-2-dropdown append-bottom control-group"&gt; &lt;select class="span3 required" name="minBedrooms" id="minBedrooms"&gt; &lt;option value=""&gt;Bedrooms&lt;/option&gt; &lt;option value='1-2'&gt;1-2&lt;/option&gt;&lt;option value='2-4'&gt;2-4&lt;/option&gt;&lt;option value='4+'&gt;4+ &lt;/option&gt; &lt;/select&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="input select"&gt; &lt;div class=""&gt;&lt;/div&gt; &lt;div class="span-4 step-2-dropdown append-bottom control-group"&gt; &lt;select class="span3 required" name="minBathrooms" id="minBathrooms"&gt; &lt;option value=""&gt;Bathrooms&lt;/option&gt; &lt;option value='1-2'&gt;1-2&lt;/option&gt;&lt;option value='2-4'&gt;2-4&lt;/option&gt;&lt;option value='4+'&gt;4+ &lt;/option&gt; &lt;/select&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="input select"&gt; &lt;div class=""&gt;&lt;/div&gt; &lt;div class="span-8 step-2-dropdown2 append-bottom control-group"&gt; &lt;select class="span3 required" name="realtor" id="realtor"&gt; &lt;option value=""&gt;Currently Working With a Realtor&lt;/option&gt; &lt;option value="Yes"&gt;Yes&lt;/option&gt; &lt;option value="No"&gt;No&lt;/option&gt; &lt;/select&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="input select"&gt; &lt;div class=""&gt;&lt;/div&gt; &lt;div class="span-8 step-2-dropdown2 append-bottom control-group"&gt; &lt;select class="span3 required" name="move" id="move"&gt; &lt;option value=""&gt;When Do You Plan On Moving?&lt;/option&gt; &lt;option value="30-90 days"&gt;30-90 days&lt;/option&gt; &lt;option value="90-120 days"&gt;90-120 days&lt;/option&gt; &lt;option value="I'm just looking"&gt;I'm just looking&lt;/option&gt; &lt;/select&gt; &lt;/div&gt; &lt;/div&gt; &lt;!--&lt;img src="http://localcommissionsystem.com/assets/app/images/SearchDealsLikeThis.png" /&gt;--&gt; &lt;/div&gt; &lt;div id="lead_info_2" style="display:none"&gt; &lt;center&gt; &lt;/center&gt; &lt;/div&gt; &lt;div id="lead_info_3" style="display:none"&gt; &lt;textarea class="" id="wantedArea" name="wantedArea" style="display:none;"&gt;&lt;/textarea&gt; &lt;div class="control-group"&gt; &lt;label class="control-label" for="fname"&gt;First Name&lt;/label&gt; &lt;div class="controls"&gt; &lt;input class="required" type="text" id="fname" name="fname" placeholder="First Name" /&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="control-group"&gt; &lt;label class="control-label" for="email"&gt;Email&lt;/label&gt; &lt;div class="controls"&gt; &lt;input class="required" type="text" id="email" name="email" placeholder="Valid Email Required" /&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="control-group"&gt; &lt;label class="control-label" for="phone"&gt;Cell Phone&lt;/label&gt; &lt;div class="controls"&gt; &lt;input class="required" type="text" id="phone" name="phone" placeholder="Cell Phone" /&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p></p> <p>Here is the php</p> <pre><code>&lt;?php $webmaster_email = "email@email.com"; $webmaster_email2 = "email@email.com"; $fname = $_REQUEST['fname']; $email = $_REQUEST['email']; $phone = $_REQUEST['phone']; $minBedrooms = $_REQUEST['minBedrooms']; $minBathrooms = $_REQUEST['minBathrooms']; $minPrice = $_REQUEST['minPrice']; $move = $_REQUEST['move']; $realtor = $_REQUEST['realtor']; if( !empty($_REQUEST) &amp;&amp; is_array($arrayValue) ) { $arrayValue = array(); $areas = implode("," , $_REQUEST['arrayValue']); } $emailfrom = $_REQUEST['email']; $headers = 'From: '.$emailfrom."\r\n". $email_to = "test@gmail.com, "; /* This bit sets the URLs of the supporting pages. If you change the names of any of the pages, you will need to change the values here. */ $feedback_page = "index.html"; $thankyou_page = "thankyou.html"; /* The following function checks for email injection. Specifically, it checks for carriage returns - typically used by spammers to inject a CC list. */ function isInjected($str) { $injections = array('(\n+)', '(\r+)', '(\t+)', '(%0A+)', '(%0D+)', '(%08+)', '(%09+)' ); $inject = join('|', $injections); $inject = "/$inject/i"; if(preg_match($inject,$str)) { return true; } else { return false; } } // If the user tries to access this script directly, redirect them to the feedback form, if (!isset($_REQUEST['email'])) { header( "Location: $feedback_page" ); } // If email injection is detected, redirect to the error page. elseif ( isInjected($email) ) { header( "Location: $error_page" ); } // If we passed all previous tests, send the email then redirect to the thank you page. else { mail( $email_to, "You Have a New Lead", "Name: $fname\nEmail: $email\nPhone: $phone\nMinBedrooms: $minBedrooms\nMinPrice: $minPrice\nMove Date: $move\nRealtor: $realtor\nAreas: $areas", $headers ); } echo "&lt;script&gt;window.location = 'thankyou.html'&lt;/script&gt;"; ?&gt; </code></pre> <p>My checkboxes are not returning any values. Does anyone know why? I've worked to make things correct and I think I've got the array set up right thanks to the help of another question, but I think I'm asking the wrong question in my other post. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload