WeLoveCSS Logo
Home Profile Members Search Rules Help New Posts



WeLoveCSS > PROGRAMMING LANGUAGES > Scripting and Server Side > Thanks You Page for Contact Form

Reply
  Thread Tools Display Modes
Old 24th March 12, 02:53 AM   #1
vinex08
WLC Lover
 
Join Date: Oct 2010
Posts: 94
Default Thanks You Page for Contact Form

Hi,

I want to design my Thank You Page, Unfortunately, i dont know how. Please Help.

Code:
<?php
$subject = "Request Availablity Email";

$headers = "MIME-Version: 1.0\r\n";

$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";

$headers .= "Return-Path: sample@sample.com \r\n";

$headers .= "From: do-not-reply@sample.com \r\n";

$headers .= "X-Priority: 1\r\n";

$headers .= "X-MSMail-Priority: High\r\n";

$fname = $_POST['f_name'];
$lname = $_POST['l_name'];
$message = $_POST['emessage'];
$uemail = $_POST['email'];
$phone = $_POST['telephone'];
$floor = $_POST['floor'];
$movein = $_POST['movein'];
$radio = $_POST['radio1'];

$whole = "From: $uemail <br /> Fullname: $fname-$lname <br /> Phone:$phone <br /> FloorPlan: $floor <br /> Move-in Date: $movein <br /> Visited the CasaVerde Location: $radio1 <br />$message";

if(mail("sample@sample.com", $subject, $whole, $headers)){
        echo "Thanks! We will get back to you as soon as possible!<br /><br />";

		
		echo $fname."<br />";
		echo $lname."<br />";
		echo $uemail."<br />";
		echo $phone."<br />";
		echo $message."<br />";
	
// if only i can design something here (like html or somethin, but if i change the code, the email will work but i'll get a 500 page ) 

}else{
        echo mysql_error();
}
?>
Here is the Form

Code:
<form action="send.php" method="post" name="contactForm" id="contactForm">
  <table width="200" style="border:0px;">
  <tr>
    <td>*FirstName:</td>
    <td><input type="text" name="f_name" /></td>
  </tr>
  <tr>
    <td>*LastName:</td>
    <td><input type="text" name="l_name" /></td>
  </tr>
  <tr>
    <td>*Email Address:</td>
    <td><input type="text" name="email" /></td>
  </tr>
  <tr>
    <td>Phone Number:</td>
    <td><input type="text" name="telephone" /></td>
  </tr>
  <tr>
    <td>Floorplan</td>
    <td>
    <select name="floor">
    <option value="Any">Any</option>
    <option value="1 Bedroom">1 Bedroom</option>
    <option value="2 Bedroom">2 Bedroom</option>
    </select>
    </td>
  </tr>
  <tr>
    <td>*Move-in</td>
    <td><input type="text" name="movein" /></td>
  </tr>
  <tr>
    <td>*Have you visited this community:</td>
    <td>
    Yes:<input type="radio" name="radio1" value="Yes" checked />
    No:<input type="radio" name="radio1" value="No" />
    </td>
  </tr>
  <tr>
    <td colspan="2">Message:<br /><textarea cols="30" rows="3" name="emessage" ></textarea> </td>
  </tr>
  <tr>
    <td colspan="2"><input type="submit" value="Submit" /></td>
  </tr>
</table>
</form>
 </form>

Also, the Floorplan Dropdown and Radio Buttons (yes, no) doesnt get included in the email. Do i have to use arrays for the dropdown?

Thanks a lot!

Last edited by vinex08; 24th March 12 at 03:22 AM.
vinex08 is offline   Reply With Quote
Old 24th March 12, 03:17 AM   #2
vinex08
WLC Lover
 
Join Date: Oct 2010
Posts: 94
Default Re: Thanks You Page for Contact Form

Or if the email was successful, it will just redirect to the Thankyou Page, Saying, "Thanks blah blah blah and it will output the Information inputted.

I tried changing the

echo "Thanks! We will get back to you as soon as possible!<br /><br />";

to

redirect('thanks.php');

but i get an page error(500)
vinex08 is offline   Reply With Quote
Old 24th March 12, 11:52 AM   #3
chrishirst
Banned
 
Join Date: Jun 2006
Location: Blackp ool U.K.
Posts: 3,197
Default Re: Thanks You Page for Contact Form

You cannot send headers (which a redirect is) to a user agent once text output has been sent.
chrishirst is offline   Reply With Quote
Reply


Thread Tools
Display Modes
Linear Mode Linear Mode

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:39 PM.



Home | Advertise | Contact Us | Top
Home | Advertise | Contact Us | Top

Copyright© 2006 WeLoveCSS.com. All Rights Reserved.
Powered by vBulletin Version 3.8.4 Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.