So, i have this form in a php file and i want it to show in this sliding div but it doesn’t show any of the php file with my include file. ANy suggestions?
I think im trying to inlcude the php file incorrectly
Here is the doc:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script src="js/jquery-1.7.1.js" type="text/javascript"></script>
<style type="text/css">
#wrap {
}
#box1 {
background: red;
width: 800px;
height: 100px;
}
#box2 {
background: blue;
width: 800px;
height: 200px;
display: none;
}
#box3 {
background: green;
width: 800px;
height: 100px;
}
.expand {
}
</style>
<script type="text/javascript">
$(function() {
$("#wrap a.expand").click(function() {
$('#box2').slideToggle('900');
});
});
</script>
</head>
<body>
<div id="wrap">
<p>
<a href="#" class="expand">Expanding/Collapse</a>
</p>
<p>
<a href="www.google.com">Google</a>
</p>
<div id="box1" alt="box"></div>
<div id="box2" alt="box">
<?php include("test.php"); ?>
</div>
<div id="box3" alt="box"></div>
</div>
</body>
</html>
And here is the php file
<?php
if ($_POST["email"]<>'') {
$ToEmail = 'email@email.site';
$EmailSubject = 'Portfolio Contact .com';
$mailheader = "From: ".$_POST["email"]."\r\n";
$mailheader .= "Reply-To: ".$_POST["email"]."\r\n";
$mailheader .= "Content-type: text/html; charset=iso-8859-1\r\n";
$MESSAGE_BODY = "Name: ".$_POST["name"]."";
$MESSAGE_BODY .= "Email: ".$_POST["email"]."";
$MESSAGE_BODY .= "Comment: ".nl2br($_POST["comment"])."";
mail($ToEmail, $EmailSubject, $MESSAGE_BODY, $mailheader) or die ("Failure");
?>
Your message was sent
<?php
} else {
?>
<form action="test.php" method="post">
<table width="400" border="0" cellspacing="2" cellpadding="0">
<tr>
<td width="29%" class="bodytext">Your name:</td>
<td width="71%"><input name="name" type="text" id="name" size="32"></td>
</tr>
<tr>
<td class="bodytext">Email address:</td>
<td><input name="email" type="text" id="email" size="32"></td>
</tr>
<tr>
<td class="bodytext">Comment:</td>
<td><textarea name="comment" cols="45" rows="6" id="comment" class="bodytext"></textarea></td>
</tr>
<tr>
<td class="bodytext"> </td>
<td align="left" valign="top"><input type="submit" name="Submit" value="Send"></td>
</tr>
</table>
</form>
<?php
};
?>
and change this if to
@$_POST["email"]<>''with at sign and your error will be hide