webdesigner93, on 07 November 2010 - 03:24 PM, said:
Yes u can add html style anything u like just as long as u keep the redirect at the top of the page before any html ect.. other then that u can put the html tags ect.. below that redirect if u need help let me know
Sorry to be a pain, ive tried adding my html where i thought it should go but im getting php errors again now:
Parse error: syntax error, unexpected '<' in /home/topulfql/public_html/mail_send.php on line 140
Could you take a look at my code, i'm obviously doing it completely wrong :/
<?php
/*
Rizo Contact Form Mailer v1.9-- is a free and secure form mailer that you may
use for your website.
(C) Copyright Steve Morgan 2010 all rights reserved.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
To read the GNU General Public License, see http://www.gnu.org/licenses
*/
error_reporting(E_ALL);
//Check if the form was submitted or not
if (!isset ($_POST['submit'])) {
header("Location:contact.html");
}
//BOTS TO BLOCK
$bots = "/(Indy|Blaiz|Java|libwww-perl|Python|OutfoxBot|User-Agent|PycURL|AlphaServer|T8Abot|Syntryx|WinHttp|WebBandit|nicebot)/i";
//BADWORDS TO BLOCK
$badwords = "/(bitch|dick|pussy|pussies|ass|****|cum|cumshot|cum shot|
gangbang|gang bang|god dammit|goddammit|viagra|anus|analsex)/i";
//EXPLOITS TO BLOCK
$known_exploits = "/(content-type|bcc:|cc:|javascript|onclick|document.cookie|onload)/i";
//Check if known bot is visiting
if (preg_match($bots, $_SERVER["HTTP_USER_AGENT"])) {
exit ("Sorry bots are not allowed here!");
}
/*
------------------------------------------------------------------------
--------------------------------------------------------------------------------
*/
//YOUR EMAIL ADDRESS
$YOUR_EMAIL = "feedback@top-titles.co.uk";
//Your email address
$YOURWEBSITE = "My website";
//Your website
$Badword_mask = "****";
//Characters u wanna replace sent badwords with
//CREATE INPUT FILTER FUNCTION
function mss($string) {
return addslashes(trim(strip_tags(rawurldecode($string))));
}
//END OF INPUT FILTERING FUNCTION
//OUR MAIN PHP VARIABLES
$name = (isset ($_POST['name'])) ? mss($_POST['name']) : FALSE;
$email = (isset ($_POST['email'])) ? mss($_POST['email']) : FALSE;
$message = (isset ($_POST['message'])) ? mss($_POST['message']) : FALSE;
$email_check = "/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,6}$/i";
$ip = (isset ($_SERVER['REMOTE_ADDR'])) ? mss($_SERVER['REMOTE_ADDR']) : FALSE;
//Error array
$errors = array();
//END OF VARIABLE CREATION
/*
INPUT VALIDATION STARTS
*/
if (!$name) {
$errors[] = "Please enter your name!";
}
if (!$email) {
$errors[] = "Please enter your email address!";
}
else
if ($email) {
if (!preg_match($email_check, $email)) {
$errors[] = "You must enter a valid email address!";
}
}
if (!$message) {
$errors[] = "You must enter a message!";
}
//Check if any errors exist if they do display the errors
if (count($errors) > 0) {
foreach ($errors as $error) {
echo "• $error<br />";
}
}
else {
//Send the email
$body = "";
$body .= "You have received an email from $YOURWEBSITE\n\n";
/*
-----------------------------------------------------------------
Loop through post array
-------------------------------------
*/
foreach ($_POST as $key => $value) {
/*
-----------------------------------------------------------------
Badword checking
-------------------------------------
*/
if (preg_match($badwords, $value)) {
$value = preg_replace($badwords, $Badword_mask, $value);
}
/*
-----------------------------------------------------------------
End of badword checking
-------------------------------------
*/
/*
-----------------------------------------------------------------
Exploit checking & blocking
-------------------------------------
*/
if (preg_match($known_exploits, $value)) {
$value = preg_replace($known_exploits, "", $value);
}
/*
-----------------------------------------------------------------
End Exploit checking & blocking
-------------------------------------
*/
$body .= ucwords($key) . ":$value\n\n";
}
/*
-----------------------------------------------------------------
End post array loop
-------------------------------------
*/
$body .= "IP:$ip\n\n";
$body .= "Browser:" . $_SERVER['HTTP_USER_AGENT'] . "\n\n";
//SET UP HEADERS
if (strstr($_SERVER['SERVER_SOFTWARE'], "Win")) {
$headers = "From:$YOUR_EMAIL\r\n";
$headers .= "Reply-To:$email\r\n";
}
else {
$headers = "From:$YOURWEBSITE <$YOUR_EMAIL>\r\n";
$headers .= "Reply-To:$email\r\n";
}
<!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" xml:lang="en">
<head>
<title>TITLE</title>
<meta name="keywords" content="KEYWORDS" />
<meta name="description" content="DESCRIPTION" />
<link rel="stylesheet" href="styles.css" type="text/css" media="all" />
</head>
<body>
<div id="container">
<div id="header">
<div id="navigation">
<ul id="menu">
<li><a href="index.html">HOME</a></li>
<li><a href="about.html">ABOUT</a></li>
<li class="wide"><a href="portfolio.html">PORTFOLIO</a></li>
<li class="wideb"><a href="services.html">SERVICES</a></li>
<li class="widec contact"><a href="contact.html">CONTACT</a></li>
</ul>
</div>
</div>
<div id="content">
//SEND THE EMAIL
if (mail($YOUR_EMAIL, $body, $headers)) {
echo "Your email has successfully been sent!<br /><br />";
}
else {
echo "We can not send the email at this time please try again later!";
exit ();
}
}
</div>
<div id="footer">
<div id="footer_content">
<p>
Copyright 2010 Andrew Turner. All rights reserved.
</p>
<ul id="footer_menu">
<li class="current"><a href="index.html">Home</a></li>
<li><a href="about.html">About</a></li>
<li><a href="portfolio.html">Portfolio</a></li>
<li><a href="services.html">Services</a></li>
<li><a href="contact.html">Contact</a></li>
</ul>
</div>
</div>
</body>
?>