Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,151,127 members, 7,811,181 topics. Date: Sunday, 28 April 2024 at 05:29 AM

I Need Help On My Php Request Form! - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / I Need Help On My Php Request Form! (1411 Views)

How To Improve My Php Skills / My Php Diary / How Do I Install Php, My Sql To Kit Start My Php Programming Lesson. (2) (3) (4)

(1) (Reply) (Go Down)

I Need Help On My Php Request Form! by feelme3(m): 8:28pm On Aug 19, 2011
Please can anybody help me with this code. Am trying to process my form for the 1st time with php and its not going as I've been made to believe. I've submited the for three times but yet to recieve it in the specified email address. Please, am I missing something? Abeg, sombody please help.

the FORM
<script src="js/functions.js"></script>
<form method="post" action="sendmail.php" onSubmit="return validateForm(Array('FirstName', 'LastName', 'Email', 'WorkPhone'), this);" name="contact" id="contact">
<input type="hidden" name="Source" value="9" />
<div class="set" id="req-fields">
<h3>Required Info</h3>
<label for="FirstName" class="required">First name</label>
<input type="text" name="FirstName" class="text" /><br class="clear" />
<label for="LastName" class="required">Last name</label>
<input type="text" name="LastName" class="text" /><br class="clear" />
<label for="Email" class="required">Email</label>
<input type="text" name="Email" class="text" /><br class="clear" />
<label for="WorkPhone" class="required">Daytime phone</label>
<input type="text" name="WorkPhone" class="text" /><br class="clear" />
<div class="field-note">(to discuss your needs and make specific recommendations)</div>
<div class="clear"></div>
<div class="continue-arrow"></div>
</div>
<div class="set" id="opt-fields">
<h3>Helpful Info <span class="note">(optional)</span></h3>
<label for="BestTimeToContact">Best time to reach you</label>
<input type="text" name="BestTimeToContact" class="text" /><br class="clear" />

<label for="DepartureCity">Departure city</label>
<input type="text" name="DepartureCity" class="text" /><br class="clear" />

<label for="Destination">Destination</label>
<input type="text" name="Destination" class="text" /><br class="clear" />

<label for="TravelDates">When will you travel?</label>
<input type="text" name="TravelDates" class="text" /><br class="clear" />

<label for="NumberOfNights">How many nights?</label>
<select name="NumberOfNights">
<option>Please select</option>
<option value="1-2 Nights">1-2 Nights</option>
<option value="3-6 Nights">3-6 Nights</option>
<option value="7-9 Nights">7-9 Nights</option>
<option value="10-14 Nights">10-14 Nights</option>
<option value="Over 14 Nights">Over 14 Nights</option>
</select><br class="clear" />

<label for="PerPersonBudget">Your per-person budget</label>
<select name="PerPersonBudget">
<option>Please select</option>
<option value="under $1000">under $1000</option>
<option value="$1001 - $1500">$1001 - $1500</option>
<option value="$1500 - 2500">$1500 - 2500</option>
<option value="$2501 - $5000">$2501 - $5000</option>
<option value="$5000+">$5000+</option>
</select><br class="clear" />

<!-- <label for="TravelStyle">Your travel style</label>
<select name="TravelStyle">
<option>Please select</option>
<option value="Deluxe/luxury">Deluxe/luxury</option>
<option value="Good Quality/moderate">Good Quality/moderate</option>
<option value="Budget/basic">Budget/basic</option>
</select><br class="clear" />-->

<label for="HowHeardAbout">How did you hear about us?</label>
<select name="HowHeardAbout" class="wide">
<option>Please select</option>
<option value="Amtrak.com">Amtrak.com</option>
<option value="AOL">AOL</option>
<option value="CNBC">CNBC</option>
<option value="CruiseCritic">CruiseCritic</option>
<option value="Cruiseline referral">Cruiseline referral</option>
<option value="Email Specials">Email Specials</option>
<option value="Friend/Customer referral">Friend/Customer referral</option>
<option value="Google">Google</option>
<option value="Google Ad Words">Google Ad Words</option>
<option value="Magazine">Magazine</option>
<option value="Mailer">Mailer</option>
<option value="MSN">MSN </option>
<option value="Newspaper">Newspaper</option>
<option value="NorthWest Airlines">Northwest Airlines</option>
<option value="NWA.com">NWA.com</option>
<option value="NWA Worldsperks Visa">NWA Worldsperks Visa</option>
<option value="Radio/TV">Radio/TV</option>
<option value="TravelZoo">TravelZoo</option>
<option value="US Bank">US Bank</option>
<option value="Yahoo">Yahoo</option>
<option value="Other Search Engine">Other Search Engine</option>
<option value="Other">Other</option>
</select><br class="clear" />

<label for="Comments" class="comments">Anything else you'd like us to know about this trip so we can best meet your needs</label>
<textarea name="Comments"></textarea><br class="clear" />
<div class="clear"></div>
<div class="continue-arrow"></div>
</div>
<div id="submit-box">
<div id="captcha">
<img src="form/captcha.php" alt="" /><br/>
Please enter the code shown above: <input MAXLENGTH="8" SIZE="8" name="userstring" type="text" value=""/>
</div>
<button type="submit">Contact Us!</button>
</div>
</form>

The sendmail php code
<?php
$FirstName = $_REQUEST['FirstName'] ;
$LastName = $_REQUEST['LastName'] ;
$Email = $_REQUEST['Email'] ;
$WorkPhone = $_REQUEST['WorkPhone'] ;

mail( "edyfriendslink@yahoo.com", "Feedback Form Results", $FirstName, $WorkPhone, $Email );
header( "Location: http://www.multiterrain.com/thankyou.html" );
?>
Re: I Need Help On My Php Request Form! by Fayimora(m): 11:08pm On Aug 19, 2011
Firstly, re-run it and add tis at the top of your file:

   error_reporting(1);


Also try sending an ordinary mail. I mean something like:

<?php
      $to      = 'nobody@example.com';
      $subject = 'the subject';
      $message = 'This is the message';
      $headers = 'From: webmaster@example.com' . "\r\n" .
                        'Reply-To: webmaster@example.com' . "\r\n";

       mail($to, $subject, $message, $headers);
?>


Just run something like that on a php file to make sure you can actually send mails,  All am trying to do is narrow down the problem. If that doesn't work then you dont have your mail port working properly. If true that what host you using, Apache with XAMPP? Then you need to configure a few lines in your http.conf
Re: I Need Help On My Php Request Form! by IbroSaunks(m): 12:09pm On Aug 26, 2011
why are u using the $_REQUEST environment variable, u said method = "post". try using $_POST naw.

@fayimora,

that error reporting stuff, isn't it something you can set in php.ini? Cos i think if it was me and i was writing code i would forget sometimes.
Re: I Need Help On My Php Request Form! by Fayimora(m): 12:15pm On Aug 26, 2011
Yes you can set it in php.ini howver I kinda prefer reporting my errors only when debugging! What happens if u dnt hav access to d php.ini file?? cheesy
Re: I Need Help On My Php Request Form! by IbroSaunks(m): 12:20pm On Aug 26, 2011
Fayimora:

Yes you can set it in php.ini howver I kinda prefer reporting my errors only when debugging! What happens if u dnt hav access to d php.ini file?? cheesy
yeah i can do it on my own localhost, but when its time for hosting it can be set to 0 on the server, wink
Re: I Need Help On My Php Request Form! by Fayimora(m): 12:36pm On Aug 26, 2011
Exactly!
Re: I Need Help On My Php Request Form! by IbroSaunks(m): 12:38pm On Aug 26, 2011
novin do u! wink

(1) (Reply)

Ideas On How To Setup And ICT HUB / My PC Can No Longer Detect My Mobile Hotspot But Can Detect Others / Pacific School Software

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 36
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.