highalpine
10-01-2008, 08:54 PM
I'm trying to embed a contact php script into my website and it shows some of the php code on the html site...
Here is the script
<?php
$name = $_POST['name'];
$sub = $_POST['sub'];
$address = $_POST['email'];
$msg = $_POST['msg'];
$ip = $_SERVER['REMOTE_ADDR'];
$mess = "
Subject: $sub \n
Message: $msg \n
From: $address \n
IP: $ip \n
";
if ( (!$name)||(!$sub)||(!$msg) ){
echo "Please fix the following:<BR>";
if(!$name){
echo "Please fill in your name<BR>";
}
if(!$sub){
echo "Please fill in the subject<BR>";
}
if(!$msg){
echo "Please fill in the message<BR><BR>";
}
echo('
<form action="contact.php" method="post">
Name: <input type="text" name="name" class="input"><BR>
Subject: <input type="text" name="sub" class="input"><BR>
E-mail <input type="text" name="email" class="input"><BR>
Message:
<textarea name="msg" rows="7" cols="50" class="input"></textarea>
<input type="submit" value="Send" class="button">
</form>');
} else {
mail("kandflawncare@gmail.com", "Subject: $sub", $mess, "From: $name <$address>");
if(mail) {
echo "Thank you! Please wait up to 24 hours for a reply.";
} else {
echo "The message could not be sent. Please try again later.";
}
}
?>
and here is a link to the page that I'm trying to embed it in with the problem shown on the page.
http://kandflawncare.funurl.com/contact.html
and this is a page with just the php script
http://kandflawncare.funurl.com/contact.php
Any help would be greatly taken.....
Thanks,
K&F Lawn Care
Here is the script
<?php
$name = $_POST['name'];
$sub = $_POST['sub'];
$address = $_POST['email'];
$msg = $_POST['msg'];
$ip = $_SERVER['REMOTE_ADDR'];
$mess = "
Subject: $sub \n
Message: $msg \n
From: $address \n
IP: $ip \n
";
if ( (!$name)||(!$sub)||(!$msg) ){
echo "Please fix the following:<BR>";
if(!$name){
echo "Please fill in your name<BR>";
}
if(!$sub){
echo "Please fill in the subject<BR>";
}
if(!$msg){
echo "Please fill in the message<BR><BR>";
}
echo('
<form action="contact.php" method="post">
Name: <input type="text" name="name" class="input"><BR>
Subject: <input type="text" name="sub" class="input"><BR>
E-mail <input type="text" name="email" class="input"><BR>
Message:
<textarea name="msg" rows="7" cols="50" class="input"></textarea>
<input type="submit" value="Send" class="button">
</form>');
} else {
mail("kandflawncare@gmail.com", "Subject: $sub", $mess, "From: $name <$address>");
if(mail) {
echo "Thank you! Please wait up to 24 hours for a reply.";
} else {
echo "The message could not be sent. Please try again later.";
}
}
?>
and here is a link to the page that I'm trying to embed it in with the problem shown on the page.
http://kandflawncare.funurl.com/contact.html
and this is a page with just the php script
http://kandflawncare.funurl.com/contact.php
Any help would be greatly taken.....
Thanks,
K&F Lawn Care