Move the include('inc/footer.php'); to the last line - if there is an error its probibly not showing on screen but will on the 'view source'.
I would move the whole if($_POST['setp']==1){ to the very top of your script and make sure there are no extra spaces. having an extra space anywhere in the code before a header() can break it - however you normally get an error.
Try it anyway, if nothing else, it'll improve your code layout and flow
CODE
<?php
if ($_POST['step'] == 1){
$to = "myemail@domain.com";
$name= $_REQUEST['name'];
$email = $_REQUEST['email'];
$phone = $_REQUEST['phone'];
$subject = "Booking from $name <$email>";
$address = $_REQUEST['address'];
$date = $_REQUEST['date'];
$time = $_REQUEST['time'];
$comments = $_REQUEST['comments'];
$message = "Hi, you have received a booking from $name. ";
$headers = "From: $name <$email>";
if(mail($to, $subject, $message, $headers)){
header("Location: ./thankyou.html");
}else{
echo 'ERROR: '.$to.', '.$subject.', '.$message.', '.$headers;
die();
}
}
include('inc/header.php');
require("admin/conf.php");
mysql_connect("$DBHost","$DBUser","$DBPass");
$request = explode("/",$_SERVER["REQUEST_URI"]);
$pagename = $request[1];
$tid=$_GET['id'];
$catname=$_GET['name'];
?>
<div class="main-box">
<div class="main-box-1">
<?php $result=mysql("$DBName","SELECT * FROM category WHERE name = '$catname'");
while($row=mysql_fetch_row($result)) {
$id=$row[0];
$catname = $row[1];
}
?>
<h2><?php echo"<img src=\"images/cat_images/$id-2.jpg\" width=\"138\" height=\"29\" alt=\"\" title=\"\" class=\"png\" />"; ?></h2>
<h3><img src="images/txt_profile.png" width="54" height="11" alt="Profile" title="" class="png" /></h3>
<?php $result2=mysql("$DBName","SELECT * FROM profile WHERE id = '$id'");
while($row2=mysql_fetch_row($result2)) {
$id = $row2[0];
$tname = $row2[1];
$tsynopsis = $row2[3];
$tdetails = $row2[4];
$temail= $row2[5];
$tphone= $row2[6];
$taddress = $row2[7];
}
?>
<?php echo"<img src=\"images/profile_images/main/$id-1.jpg\" width=\"119\" height=\"119\" alt=\"\" class=\"bord-1-left\" />";?>
<h3><?php echo "$tname - $catname Profile"; ?></h3>
<p class="nopadbotm"><?php echo "$tsynopsis"; ?><br /><br/>
<ul class="var-1">
<?php echo "$tdetails"; ?> <br/><br/>
</ul>
<p class="nopadbotm"><img src="images/icon_phone.gif" width="29" height="29" alt="" class="valmid" /> To contact <?echo "$tname";?>, please call on : <span class="style-1"><?echo "$tphone";?></span>.</p>
<div class="separ-line-1">
<!---->
</div>
<div class="formfield-1">
<h3><img src="images/txt_book-appointment.png" width="139" height="11" alt="Book Appointment" title="" class="png" /></h3>
<form method="post" action="<?php $_SERVER['PHP_SELF']?>">
<input type="hidden" name="step" value="1">
<table>
<tr>
<td>Full Name:</td>
<td><input name="name" type="text" size="24"></td>
</tr>
<tr>
<td>Email:</td>
<td><input name="email" type="text" size="24"></td>
</tr>
<tr>
<td>Phone:</td>
<td><input name="phone" type="text" size="24"></td>
</tr>
<tr>
<td>Address:</td>
<td><input name="address" type="text" size="51"></td>
</tr>
<tr>
<td> Preferred date of appointment:</td>
<td><input name="date" type="text" size="24"></td>
</tr>
<tr>
<td> Preferred time of appointment:</td>
<td><input name="time" type="text" size="24"></td>
</tr>
<tr>
<td>Comments:</td>
<td ><textarea rows="7" name="comments" cols="43"></textarea></td>
</tr>
<tr>
<td></td>
<td> <p class="submit-btn">
<input type="image" src="images/btn_book-now.png" class="btn png" />
</p></td>
</tr>
</table>
</form>
</div>
</div>
</div>
<!--main-box-->
<?php
include('inc/footer.php');
?>
If that doesnt work i'd use a javascript redirect that triggers on the body onload <- not ideal but will do until you figure out the PHP prob
This post has been edited by pemcconnell: 25 Aug, 2008 - 03:46 AM