...

View Full Version : page not working properly



chelvis
02-08-2006, 02:26 PM
I have a form (contact_us.php) and when a user submits the form it displays a thank you page (thankyou.php) and sends an email to me. The intermediate page which does all the functionality is called contact_action.php. When I opened the contact_us.php and clicked the submit button, instead of showing the thankyou.php the page opens a blank page and the address bar says contact_action.php. Why is this happening? Is it some thing wrong with my code or something to do with the server? Because 2 days ago everything was working fine.

Can some one tell me is there anything wrong with my code or this is somehting to do with the server?

Here is the code:
contact_us.php:
<?
$section="contact us";
$title="contact us";
$head="";
$content = <<< CONTENT
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td style="width:375px;border:0px;border-right:10px;border-color:#FFFFFF;border-style:solid;" align="left" valign="top"><img src="assets/imgs/contactus_photo.jpg" width="375" height="432"></td>
<td style="background-color:#FF0099;" align="center" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0" style="margin:10px;">
<form action="contact_action.php" method="post">
<tr><td style="padding-top:20px;padding-bottom:10px;font-size:11px;font-weight:bold;">Please join our mailing list:</td></tr>
<tr> <td align="center" valign="top">
<table width="75%" border="0" cellspacing="4" cellpadding="0" align="center">
<tr><td class="form-field-name-cell" nowrap>Name:</td>
<td><input type="text" name="name" class="form-field"></td></tr>
<tr>
<td class="form-field-name-cell" nowrap>Email:</td><td><input type="text" name="email" class="form-field"></td></tr>
<tr>
<td class="form-field-name-cell" nowrap>Company:</td><td><input type="text" name="company" class="form-field"></td></tr>
<tr>
<td class="form-field-name-cell" nowrap>Address:</td><td><input type="text" name="address" class="form-field"></td></tr>
<tr>
<td class="form-field-name-cell" nowrap>State / Zip</td><td><input type="text" name="zip" class="form-field"></td></tr>
<tr>
<td class="form-field-name-cell" nowrap>Phone:</td><td><input type="text" name="phone" class="form-field"></td></tr>
</table></td></tr>
<tr><td style="padding-left:2px;vertical-align:top;font-size:11px;">Message/Where did you find our site?</td></tr>
<tr><td style="padding-top:10px;" valign="top" align="center"><textarea name="message" style="width:260px;height:100px;"></textarea></td></tr>
<tr><td style="padding-top:20px;padding-left:20px;">
<input type="image" border="0" name="imageField" src="assets/imgs/send_brown.gif" width="71" height="26">
<input type="image" onClick="this.form.reset();return false;" border="0" name="imageField2" src="assets/imgs/clear_brown.gif" width="71" height="26">
</td></tr></form></table>
</td></tr></table>
CONTENT;
?>

Here is the contact_action.php:
<?
$name = $_REQUEST["name"];
$email = $_REQUEST["email"];
$company = $_REQUEST["company"];
$address = $_REQUEST["address"];
$zip = $_REQUEST["zip"];
$phone = $_REQUEST["phone"];
$message = $_REQUEST["message"];

$message = <<< STREAM_IN
Name: $name
Email: $email
Company: $company
Address: $address
Zip: $zip
Phone: $phone
Message: $message
STREAM_IN;

$headers = "From: $email\r\n"
."Reply-To: $email\r\n"
."X-Mailer: PHP/" . phpversion();

mail("mymail@gmail.com", "Kiki Riki : Contact Us Mail", $message, $headers);
//mail("@hotmail.com", "Kiki Riki : Contact Us Mail", $message, $headers);

header("Location: thankyou.php");
?>

Here is the thakyou.php:
<?

$section="contact us";
$title="contact us";
$head="";

$content = <<< CONTENT
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td style="width:375px;border:0px;border-right:10px;border-color:#FFFFFF;border-style:solid;" align="left" valign="top"><img src="assets/imgs/contactus_photo.jpg" width="375" height="432"></td>
<td style="background-color:#FF0099;" align="center" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0" style="margin:10px;">
<tr>
<td style="padding-top:20px;padding-bottom:10px;font-size:11px;font-weight:bold;">You will be added to our mailing list shortly.<br/><br/>Thank you.</td>
</tr>
</table>
</td>
</tr>
</table>
CONTENT;


?>

degsy
02-08-2006, 03:32 PM
Check with your host to see if they have done any updating or tweaking of PHP.

Try putting this at the top of contact_action.php


error_reporting(E_ALL);


Why use heredoc? Sorry, I just don't like it :D

vinyl-junkie
02-09-2006, 03:30 AM
Look in your server error log. You probably have something there that will tell you what's wrong.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum