Using Location: to Redirect PHP on form submit
Ok, I have this page where the user submits a form using <form name="form1" method="post"
action="<?php echo $_SERVER['PHP_SELF']; ?> and it runs this code below. Basically sends and email and writes some files to the database. I want that page to direct to a new page at the end. I have tried using location: newpage.php in various spots but can't get it to run. Everything else works great. Thanks.
below resides in HEAD
<?php
// our e-mail function
function send_mail($from_name, $from_email, $message) {
$to = $_REQUEST['to_email'];
$subject = "sub";
$headers .= "From: $from_name <$from_email>\n";
$headers .= "Reply-To: $from_name <$from_email>\n";
$send_mail = mail($to, $subject, $message, $headers);
if ($send_mail) {
return true;
} else {
return false;
// check that the form is truly sent
if ($_POST['send'] == 1) {
// get data from the form
//$from_name=$_POST['from_name'];
$to_email=$_POST['to_email'];
echo $to_mail;
$from_email=$_POST['from_email'];
$message=$_POST['fname']." ".$_POST['lname']";
//mysql_query("INSERT INTO table (this, this and this)
//VALUES ($_POST['id'], $_POST['field2'])");
mysql_select_db($blah, $blah);
$result=mysql_query("INSERT INTO blah (id, field2) values( '','$id','$field2')");
// send e-mail
$try_mail = send_mail($from_name, $from_email, $message);
// output the result
if ($try_mail) {
echo "Your e-mail message was sent!";
} else {
echo "Your e-mail message was not sent!";
?>
That looks like the correct answer, DW inserts the following similar code when creating an db insert or update, as one of the options to goto a page after the insert. This one uses the header function to perform the same thing.
$insertGoTo = "some_new_file.php";
if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $HTTP_SERVER_VARS['QUERY_STRING'];
header(sprintf("Location: %s", $insertGoTo));
Just be sure to perform all the emailing and updating before this code.
Watch out for header issues as explained here
http://php.net/manual/en/function.header.php
-Daniel
Similar Messages
-
Using Captcha within a .php file form
Hello all - I need to add a captcha to an existing php form. The form is located in a .php file. I know this issue is not a Dreamweaver problem per se, but hoping someone here has had some experience with Captcha and .php files.
when I add the following to the <form>
require_once('recaptchalib.php');
$publickey = "your_public_key"; // you got this from the signup page
echo recaptcha_get_html($publickey);
I end up with a blank white page. Note: the public key has been added in my file.
There is a note in the tutorial that states:
<html>
<body> <!-- the body tag is required or the CAPTCHA may not show on some browsers -->
<!-- your HTML content -->
It is my understanding that <html> and <body> cannot/should not be added to .php pages. If this is true, can captcha work within a .php file?
Thanks in advance for any and all help.
GenegenoMU69 wrote:
Nancy - thanks.
What you're saying make sense.
When I added the code below:
require_once('recaptchalib.php');
$publickey = "your_public_key"; // you got this from the signup page
echo recaptcha_get_html($publickey);
to the form with my actual public key included
and:
<?php
require_once('recaptchalib.php');
$privatekey = "your_private_key";
$resp = recaptcha_check_answer ($privatekey,
$_SERVER["REMOTE_ADDR"],
$_POST["recaptcha_challenge_field"],
$_POST["recaptcha_response_field"]);
if (!$resp->is_valid) {
// What happens when the CAPTCHA was entered incorrectly
die ("The reCAPTCHA wasn't entered correctly. Go back and try it again." .
"(reCAPTCHA said: " . $resp->error . ")");
} else {
// Your code here to handle a successful verification
?>
to the verify php, with the private key inserted,
I end up with a blank white page, the form dissapears. I thought maybe it was because the html and body tags were not included with the parent page (of which the form is a part of)
I will inbox you the parent form page so that you can see what I'm working with. Thanks again for you help.
G
At this stage I'd do a test.
Just include the form and captcha stuff in a page on its own and see what the results are. (obviously include the <body><html> tags.
If it works that means there is a problem with your real set up. If it doesnt it means there is certainly a problem with the way you have captcha set up. -
I have a put a php mail form in the quote page of my mobile site. However when i send the form it returns to the route page rather than the quote page, i have used the data ajax false action as i dont want to send via ajax. i have left the thanks page blank as i want it to remain on the same page showing sent or declined message. Can someone help please?
<?php
// OPTIONS - PLEASE CONFIGURE THESE BEFORE USE!
$yourEmail = "[email protected]"; // the email address you wish to receive these mails through
$yourWebsite = "www.firstcalltransport.co.uk"; // the name of your website
$thanksPage = ''; // URL to 'thanks for sending mail' page; leave empty to keep message on the same page
$maxPoints = 4; // max points a person can hit before it refuses to submit - recommend 4
$requiredFields = "name,email,collection,delivery,comments"; // names of the fields you'd like to be required as a minimum, separate each field with a comma
// DO NOT EDIT BELOW HERE
$error_msg = array();
$result = null;
$requiredFields = explode(",", $requiredFields);
function clean($data) {
$data = trim(stripslashes(strip_tags($data)));
return $data;
function isBot() {
$bots = array("Indy", "Blaiz", "Java", "libwww-perl", "Python", "OutfoxBot", "User-Agent", "PycURL", "AlphaServer", "T8Abot", "Syntryx", "WinHttp", "WebBandit", "nicebot", "Teoma", "alexa", "froogle", "inktomi", "looksmart", "URL_Spider_SQL", "Firefly", "NationalDirectory", "Ask Jeeves", "TECNOSEEK", "InfoSeek", "WebFindBot", "girafabot", "crawler", "www.galaxy.com", "Googlebot", "Scooter", "Slurp", "appie", "FAST", "WebBug", "Spade", "ZyBorg", "rabaz");
foreach ($bots as $bot)
if (stripos($_SERVER['HTTP_USER_AGENT'], $bot) !== false)
return true;
if (empty($_SERVER['HTTP_USER_AGENT']) || $_SERVER['HTTP_USER_AGENT'] == " ")
return true;
return false;
if ($_SERVER['REQUEST_METHOD'] == "POST") {
if (isBot() !== false)
$error_msg[] = "No bots please! UA reported as: ".$_SERVER['HTTP_USER_AGENT'];
// lets check a few things - not enough to trigger an error on their own, but worth assigning a spam score..
// score quickly adds up therefore allowing genuine users with 'accidental' score through but cutting out real spam
$points = (int)0;
foreach ($badwords as $word)
if (
strpos(strtolower($_POST['comments']), $word) !== false ||
strpos(strtolower($_POST['name']), $word) !== false
$points += 2;
if (strpos($_POST['comments'], "http://") !== false || strpos($_POST['comments'], "www.") !== false)
$points += 2;
if (isset($_POST['nojs']))
$points += 1;
if (preg_match("/(<.*>)/i", $_POST['comments']))
$points += 2;
if (strlen($_POST['name']) < 3)
$points += 1;
if (strlen($_POST['comments']) < 15 || strlen($_POST['comments'] > 1500))
$points += 2;
if (preg_match("/[bcdfghjklmnpqrstvwxyz]{7,}/i", $_POST['comments']))
$points += 1;
// end score assignments
foreach($requiredFields as $field) {
trim($_POST[$field]);
if (!isset($_POST[$field]) || empty($_POST[$field]) && array_pop($error_msg) != "Please fill in all the required fields and submit again.\r\n")
$error_msg[] = "Please fill in all the required fields and submit again.";
if (!empty($_POST['name']) && !preg_match("/^[a-zA-Z-'\s]*$/", stripslashes($_POST['name'])))
$error_msg[] = "The name field must not contain special characters.\r\n";
if (!empty($_POST['email']) && !preg_match('/^([a-z0-9])(([-a-z0-9._])*([a-z0-9]))*\@([a-z0-9])(([a-z0-9-])*([a-z0-9]))+ ' . '(\.([a-z0-9])([-a-z0-9_-])?([a-z0-9])+)+$/i', strtolower($_POST['email'])))
$error_msg[] = "That is not a valid e-mail address.\r\n";
if (!empty($_POST['url']) && !preg_match('/^(http|https):\/\/(([A-Z0-9][A-Z0-9_-]*)(\.[A-Z0-9][A-Z0-9_-]*)+)(:(\d+))?\ /?/i', $_POST['url']))
$error_msg[] = "Invalid website url.\r\n";
if ($error_msg == NULL && $points <= $maxPoints) {
$subject = "Automatic Form Email";
$message = "You received this e-mail message through your website: \n\n";
foreach ($_POST as $key => $val) {
if (is_array($val)) {
foreach ($val as $subval) {
$message .= ucwords($key) . ": " . clean($subval) . "\r\n";
} else {
$message .= ucwords($key) . ": " . clean($val) . "\r\n";
$message .= "\r\n";
$message .= 'IP: '.$_SERVER['REMOTE_ADDR']."\r\n";
$message .= 'Browser: '.$_SERVER['HTTP_USER_AGENT']."\r\n";
$message .= 'Points: '.$points;
if (strstr($_SERVER['SERVER_SOFTWARE'], "Win")) {
$headers = "From: $yourEmail\r\n";
} else {
$headers = "From: $yourWebsite <$yourEmail>\r\n";
$headers .= "Reply-To: {$_POST['email']}\r\n";
if (mail($yourEmail,$subject,$message,$headers)) {
if (!empty($thanksPage)) {
header("Location: $thanksPage");
exit;
} else {
$result = 'Your mail was successfully sent.';
$disable = true;
} else {
$error_msg[] = 'Your mail could not be sent this time. ['.$points.']';
} else {
if (empty($error_msg))
$error_msg[] = 'Your mail looks too much like spam, and could not be sent this time. ['.$points.']';
function get_data($var) {
if (isset($_POST[$var]))
echo htmlspecialchars($_POST[$var]);
?>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<link href="CSS/stylesheetnew.css" rel="stylesheet" type="text/css">
<link href="../jquery-mobile/jquery.mobile-1.0a3.min.css" rel="stylesheet" type="text/css">
<script src="../jquery-mobile/jquery-1.5.min.js" type="text/javascript"></script>
<script src="../jquery-mobile/jquery.mobile-1.0a3.min.js" type="text/javascript"></script>
<style type="text/css">
p.error, p.success {
font-weight: bold;
padding: 10px;
border: 1px solid;
p.error {
background: #ffc0c0;
color: #F00;
p.success {
background: #b3ff69;
color: #4fa000;
</style>
</head>
<body>
<div data-role="page" id="home">
<div data-role="header" data-position="fixed">
<h1>FIRSTCALL TRANSPORT</h1>
</div>
<div data-role="navbar" data-position="fixed">
<ul>
<li><a href="#about">About</a></li>
<li><a href="#services">Services</a></li>
<li><a href="#contact">Contact</a></li>
<li><a href="#quote">Quote</a></li>
</ul>
</div>
<div data-role="content"> </div>
<div data-role="footer" data-position="fixed" > </div>
</div>
</div>
<div data-role="page" id="quote">
<div data-role="header" data-position="fixed">
<h1>GET A QUOTE</h1>
</div>
<div data-role="content">
<?php
if (!empty($error_msg)) {
echo '<p class="error">ERROR: '. implode("<br />", $error_msg) . "</p>";
if ($result != NULL) {
echo '<p class="success">'. $result . "</p>";
?>
<form action="<?php echo basename(__FILE__); ?>" method="post" data-ajax="false" >
<noscript>
<p><input type="hidden" name="nojs" id="nojs" /></p>
</noscript>
<p>
<label for="name">Name: *</label>
<input type="text" name="name" id="name" value="<?php get_data("name"); ?>" /><br />
<label for="email">E-mail: *</label>
<input type="text" name="email" id="email" value="<?php get_data("email"); ?>" /><br />
<label for="company">Company:</label>
<input type="text" name="company" id="company" value="<?php get_data("company"); ?>" /><br />
<label for="collection">Collection: *</label>
<input type="text" name="collection" id="collection" value="<?php get_data("collection"); ?>" /><br />
<label for="delivery">Delivery: *</label>
<input type="text" name="delivery" id="delivery" value="<?php get_data("delivery"); ?>" /><br />
<label for="comments">Message: *</label>
<textarea name="comments" id="comments" rows="5" cols="20"><?php get_data("comments"); ?></textarea><br />
<input type="submit" name="submit" id="submit" value="Send" <?php if (isset($disable) && $disable === true) echo ' disabled="disabled"'; ?> />
</p>
</form> </div>
<div data-role="footer" > </div>
</div>
</div>
</body>
</html>My wife has left me for four weeks, favouring to be with our son who lives 4,000 km away. I now have to cook for myself and the steaks taste horrible. What am I doing wrong?
If you do not know what I have (not) done to make the steak taste horrible, my question is as hard to answer as your question above.
Please give us more info like giving us the code that sends the page to the homepage rather than to the previous page. -
Using contact form created in DW with Business Catalyst (was: form submit)
Hi.
I hope some one can help. My son has built a contact form which he wants the contents to be sent to his email address when they submit it. His site is built using Dreamweaver and is hosted on BC, he has not used BC modules to build the site it was solely built in Dreamweaver CC and uploaded to BC. Can any one tell us what code we should be using for the form to be sent to his email as we are not sure what BC will accept.
Thanks, James.jptphotography wrote:
Hi Alex,I have found some php that hopefully will help it along, I will be trying it later.
You need to find out if BC allows php processed forms to be hosted. Questions about form processing have come up before on the forum and I seem to remember that BC has its own way of processing forms, although I could be wrong.
If you need help with setting up a php script to process the form then there are plenty of people on the forum that could give you some guidance and assistance. -
Hello all,
I'm pulling my hair out--thank you for any help you can give
me.
I have a form that a person fills out that has a field that
asks "How
many visitors including you" and I'd like them to type in a
number, and
on submit of the form, have that value -2 multiplied by 20
and inserted
into a "total cost" column.
I'm using the standard DW server behaviors and I've searched
the
internet. How do I perform basic math on that value and
insert it into
the database?
If you have any pointers, that would be great.
Thank you!
-JohnJohn R. Lenz wrote:
> Your code below works great, and I just noticed links to
your book were
> available on your web site, and it's in the mail to me.
Looking forward
> to it.
Thanks, hope you find it useful.
> After the form is posted, I'd like to address the person
who posted it
> by their first name and last name, as well as some of
the details. How
> would you go about doing this in the best way? Would you
set a variable
> and echo it on the 'Thank you' page, or are there better
ways of doing
> it with a recordset and filtering it on form submit?
To pass the details to a thank you page, you would need to
store the
information in $_SESSION variables. You could amend the
earlier script
like this:
<?php
session_start();
if (isset($_POST['visitors'])) {
if ($_POST['visitors'] < 3) {
$num = 0;
} else {
$num = $_POST['visitors'] - 2;
$_POST['total_cost'] = $num * 20;
$_SESSION['total_cost'] = $_POST['total_cost'];
$_SESSION['first_name'] = $_POST['first_name'];
$_SESSION['last_name'] = $_POST['last_name'];
?>
In the thank you page, put the following at the top of the
page:
<?php session_start(); ?>
It must go before anything is output to the browser, so put
it above the
DOCTYPE declaration, and make sure there's no space before
it.
You can then use the $_SESSION variables in the thank you
page.
At the end of the page, add this to clear up the session
variables:
<?php
$_SESSION = array();
destroy_session();
?>
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of
ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/ -
Contact Form not working using Godaddy's gdform.php
I am using Godaddy's gdform.php for the contact page, but for some reason, upon submit it sends to 404 page.
Also the site will not open in IE. Weird, it works well in Firefox, Chrome or anything else. Can someone please help me?
Thank you,
http://www.integrativehealthpsychology.com/contact.htmlIt would appear that your path to the processing script is incorrect.
Also fix all these errors:
http://validator.w3.org/check?uri=http%3A%2F%2Fwww.integrativehealthpsychology.com%2Fconta ct.html&charset=%28detect+automatically%29&doctype=Inline&group=0 -
Can anyone help with my PHP contact form please!
Hi all,
I've just implemented the email contact form as described in the PHP Solutions book by David Powers and it is working fine.
What I'm having problems with is my form is at the bottom of a long page and you have to scroll or click a link to get to it, which means that when the submit button is pressed, whether the form is successfully submitted or a field hasn't been completed, the user ends up back at the top of the page having to scroll back down to the form before they can see the feedback (either thanking them for submitting or pointing out that they have tried to submit an incomplete form).
Can anyone tell me how I can make the page redirect upon clicking submit so that the user returns to the part of the page where the form is so they can see the feedback instead of going to the top of the page where the form is out of view.
Many thanks,
Karl.I've attached the entire code from the page plus the css so you can see what's going on and in additiion I've put in the corefuncs.php include code.
Hope that's enough, thanks for looking.
Cheers,
Karl.
<?php
include('includes/corefuncs.php');
if (function_exists('nukeMagicQuotes')) {
nukeMagicQuotes();
// process the email
if (array_key_exists('send', $_POST)) {
$to = '[email protected]'; // use your own email address
$subject = 'Feedback from my form page';
// list expected fields
$expected = array('name', 'email', 'comments');
// set required fields
$required = array('name', 'email', 'comments');
// create empty array for any missing fields
$missing = array();
// assume that there is nothing suspect
$suspect = false;
// create a pattern to locate suspect phrases
$pattern = '/Content-Type:|Bcc:|Cc:/i';
// function to check for suspect phrases
function isSuspect($val, $pattern, &$suspect) {
// if the variable is an array, loop through each element
// and pass it recursively back to the same function
if (is_array($val)) {
foreach ($val as $item) {
isSuspect($item, $pattern, $suspect);
else {
// if one of the suspect phrases is found, set Boolean to true
if (preg_match($pattern, $val)) {
$suspect = true;
// check the $_POST array and any subarrays for suspect content
isSuspect($_POST, $pattern, $suspect);
if ($suspect) {
$mailSent = false;
unset($missing);
else {
// process the $_POST variables
foreach ($_POST as $key => $value) {
// assign to temporary variable and strip whitespace if not an array
$temp = is_array($value) ? $value : trim($value);
// if empty and required, add to $missing array
if (empty($temp) && in_array($key, $required)) {
array_push($missing, $key);
// otherwise, assign to a variable of the same name as $key
elseif (in_array($key, $expected)) {
${$key} = $temp;
// validate the email address
if (!empty($email)) {
// regex to ensure no illegal characters in email address
$checkEmail = '/^[^@]+@[^\s\r\n\'";,@%]+$/';
// reject the email address if it doesn't match
if (!preg_match($checkEmail, $email)) {
array_push($missing, 'email');
// go ahead only if not suspect and all required fields OK
if (!$suspect && empty($missing)) {
// build the message
$message = "Name: $name\n\n";
$message .= "Email: $email\n\n";
$message .= "Comments: $comments";
// limit line length to 70 characters
$message = wordwrap($message, 70);
// create additional headers
$additionalHeaders = 'From: domain.com Feedback Form<[email protected]>';
if (!empty($email)) {
$additionalHeaders .= "\r\nReply-To: $email";
// send it
$mailSent = mail($to, $subject, $message, $additionalHeaders, '[email protected]');
if ($mailSent) {
// redirect the page with a fully qualified URL
header('Location: http://www.domain.com/index.php#form-div');
exit;
?>
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Page | title</title>
<script type="text/javascript" src="jquery.min.js">></script>
<script type="text/javascript" src="jquery.cycle.all.2.72.js"></script>
<script type="text/javascript">
$(function() {
$('#slideshow').cycle({
speed: 1400,
timeout: 8000
</script>
<link href="main.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="wrapper" class="container">
<div id="header">
<h1 class="logo">XXX Xxxx Xxxxx</h1>
<h2 class="subhead">Xxx Xxxxxxx xxx Xxxxxx Xxxxxxx xx Xxxx xxx Xxxxx.</h2>
<div id="nav">
<h2>Need more information?</h2>
<h3>Look no further...</h3>
<ul>
<li><a class="nav-about" href="#about-div">About Us...</a></li>
<li><a class="nav-contact" href="#contact-div">Contact Us...</a></li>
</ul>
</div>
<!-- end nav -->
</div><!-- end header -->
<div id="page-content">
<div id="cycle">
<div id="cycle-nav"></div>
<div id="slideshow" class="pics">
<img src="im/slides/escape.jpg" border="0" alt="" title="" width="547" height="339" />
<img src="im/slides/old-lady.jpg" border="0" alt="" title="" width="547" height="339" />
<img src="im/slides/gouge.jpg" border="0" alt="" title="" width="547" height="339" />
<img src="im/slides/disarm.jpg" border="0" alt="" title="" width="547" height="339" /></div><!-- slideshow -->
</div><!-- cycle -->
<div id="right-column">
<div id="ladies">
<h1>Xxxxxx xxx'x xxx xxxxx xxxx xxxx.</h1>
<p>Xxxx xxxxxxxxx xxxx XXX xxxxx xxxxxxxxxx xxx xxxx xxxx xxxx xxxx!</p>
<p class="bottom">XXXX XX xx xxxx xxx xxxx...</p>
</div>
<div id="courses">
<div id="course1">
<h2 class="top"><strong>Xxxx Xxxx Xxxxxxx Xxxxxx Xxxxxxx</strong></h2>
<p>XXX Xxxx Xxxx Xxxxxxx xxxxxx xxx x xxxx-xxxx xxxxxxxx xxx xx xxxx xxxx xxxxx xxx xxxxxx.</p>
<p><strong>XXXXX:</strong> XXX.XX xxx xxxxxx.</p>
<p><strong>XXXX XXXXXX:</strong><br />
Xxxxxx Xxx Xxxx<br /><strong>[XXXXXX XXXXXXXXX]</strong></p>
<ul><strong>XXXXXX XXXXXXX:</strong>
<li>Xxxxxx Xxx Xxxxxxxxx</li>
<li>Xxxxxx Xxx Xxxxxxxx</li>
<li>Xxxxxx Xx Xxxxxxx -XXXX</li>
</ul>
<h2>Xxxx Xxxxx...</h2>
<p class="book-early">Xx xxxxx xxx xx xx xxxxxxxx xxxxxxx xxx xxx xxxxxxx xxx xxxxx xxxxxxxxxx xx x xxxxxxx xxxxxxx xxxxxxxx xx xxx xxxx xxx xxxxxxxxx xxxxxx xxxx xx xxxxx xx xxxxxxx xx xxx xxx xxxxxxxx xx xxxxxxxxx xx xxxxxx.</p>
<h2><strong>Xxxxxxxxx xx xxx Xxxxxx</strong></h2>
<p class="location"> XX. Xxxxxx Xxxx, <br />
Xxx Xxxxxxxxx Xxxxxx, Xxxxxxxx Xxxx, Xxxx (xxxxx xxx xxxx xx xxxx).<br />
Xxxxxxxx xx xxxxxxxxxxx xxxx xxxxxxxx Xxxx.</p>
<h2><strong>Xxxxxxxxx xx xxx Xxxxxx</strong></h2>
<p class="structure"><strong>Xxxxxxx xxxxxxx:</strong><br />
XX.XXxx – XX.XX xx<br />
<strong>Xxxxx xxxxx:</strong><br />
XX xxxx.<br />
Xxxxxx xxxxxxx xxxx xxx xxxxxx Xxxxx.<br />
<strong>Xxxxxxxxxx xxxxxxx:</strong><br />XX.XXxx – X.XXxx</p>
<h2><strong>Xxxxxx Xxxx...</strong></h2>
<p class="news">Xxxxx xxxx xxxxx xxx xxxx xxxxx xxx Xxxx Xxxx Xxxxxxx Xxxxxx.<br />
</p>
</div>
<div class="to-top">
<p><a href="#header">[Back to Top]</a></p>
</div>
<div id="course2">
<h2 class="top"><strong>Xxxxx Xxxx Xxxxxxx Xxxxx Xxxxxxx</strong></h2>
<p>Xxx XXX XXXXX Xxxx Xxxxxxx Xxxxx xxx x xxx-xxxx xxxxxxxx xxx xx xxxx xxxxxx.</p>
<p><strong>XXXXX:</strong> XX.XX xxx xxxxxx</p>
<p><strong>XXXX XXXXX:</strong><br />
Xxxxxx XXxx Xxx<br /><strong>[XXXXXX XXXXXXX]</strong></p>
<ul><strong>XXXXXX XXXXXXX:</strong>
<li>Xxxxxx Xxx Xxxx</li>
<li>Xxxxxx Xxx Xxxx</li>
<li>Xxxxxx Xxx Xxxx</li>
<li>Xxxxxx Xxx Xxxx</li>
</ul>
<h2>Xxxx Xxxxx...</h2>
<p class="book-early">Xx xxxxx xxx xx xx xxxxxxx xxxxxxx xxx xxx xxxxxxx xxx xxxxx xxxxxxxxxx xx x xxxxxxxxx xxxxxxx xxxxxxxx xx xxx xxxx xxx xxxxxxxxx xxxxxx xxxx xx xxxxx xx xxxxxxx xx xxx xxx xxxxxxxxxx xx xxxxxxxxx x xxxxxx.</p>
<h2><strong>Xxxxxxxxx xx xxx Xxxxx</strong></h2>
<p class="location">Xxxxxxxxx Xxxx, Xxxxxx Xxxxxx, Xxxxx, (xxx xxxxxxx xxxxxxxxx xx -<br />
Xxxxxxx xx xxxxxxxxxx xxxx - </p>
<h2><strong>Xxxxs Xxxx...</strong></h2>
<p class="news">Xxxxx xxxx xxxxx xxx xxxx xxxxx xxx Xxxxx Xxxx Xxxxxxx Xxxxx.<br />
</p>
</div><!-- Course 2 end -->
<div class="to-top">
<p><a href="#header">[Back to Top]</a></p>
</div>
</div><!-- Courses end -->
</div><!-- end right column -->
<div id="main-content" >
<div id="main-content-1" class="clearfix">
<h2>Xxxxxxx xx xxx Xxxx Xxxxxxx<br />
xxxxxxx xxxx xxx XXX.</h2>
<h3>Xxxxxx xxx Xxxxx xxxxxxx…</h3>
<p>Xxx XXX xx xx xxxxxxxxxxx xxxxx xxxxxx xxxxxxx xx xxxx xxxxxxx xx Xxxx xxx Xxxxx - Xxxx Xxxxxxxxx, xxxxxx xxxxxxxxx xx xxxxx xxxxxx xxx xxxxxx xxxxxx, xxx xxxxxxxx x xxxx xxxxxxx xx xxxxxx xxxxxxxxx xx xxxxxxxx xxxx xxxxxxx.</p>
<p>Xxx XXX xxxxxx xxx xxxxxxx xxx xxxxxxxx Xxxx Xxxxxxx xx xxx Xxxx / Xxxxx xxxx xx Xxxx Xxxxxxxxx.</p>
<p>Xxx xxxxx xxxxxx xx x xxx xxx Xxxx Xxxxxxx Xxxxxx xxxx x xxxxxxxx xx xxxxxxxxx xxxx xxxxx xxxxx xx xxxx xx Xxxx xxxx xxxxx xxx xxxxxx xx xxx Xxxxxxxx Xxxxxx.</p>
<p>Xxx xxxxxx xxxxxx xx x xxxxxx Xxxx Xxxxxxx Xxxxx xxxxx xx x xxx xxxx xxxxxxx xxx xx xxxx xx xxx xxxxxx xx xxxxx xx Xxxxxxxx Xxxx xx xxxxx Xxxxx Xxxxxx. Xxxxxxxx xxx xx xxxxx xx xxxx xxxxx.</p>
<h3 class="extra-padding">Xxx xx xx xxx xxx xxxx xxxx xxx xxxxx?</h3>
<p>Xxxx xxxxxx xx xxxxxxxxxx xxxxxx xx xxxxxx xxx xxx xxxx xxxxxx xxxxxxx xxx xxxx xxxxxx xx xx xxx xxxxxxxxxx xxx xxxx xx xxxx xx xx xxxxxxx xxxxxx xxxx xx xxxxxxxx xx xxxxxxxx xxxx xx xxxxxx xxxxxxxxxx xxxxxxx xxx xxxxxx xx xxxxx xxxxxxxx.</p>
<p>xxx xxxx xx xxxxxx xxxx xx xxxxxx xxxxxxxxxx, xx x xxxxxxxx xxx xxxxxxx xxxxxxxxxxx xxxxx xxxxxx xxxxxxxxx xxx xxxx xxxx xx xxxxxxxxxxx xxxxxx xxxx xx xxxx.</p>
<p>xxx xxxx xx xxxxxx xxxx xx xxxxxx xxxxxxxxxx, xx x xxxxxxxx xxx xxxxxxx xxxxxxxxxxx xxxxx xxxxxx xxxxxxxxx xxx xxxx xxxx xx xxxxxxxxxxx xxxxxx xxxx xx xxxx.</p>
<p>xxx xxxx xx xxxxxx xxxx xx xxxxxx xxxxxxxxxx, xx x xxxxxxxx xxx xxxxxxx xxxxxxxxxxx xxxxx xxxxxx xxxxxxxxx xxx xxxx xxxx xx xxxxxxxxxxx xxxxxx xxxx xx xxxx.</p>
<p><strong>xxx xxxx xx xxxxxx xxxx xx xxxxxx xxxxxxxxxx, xx x xxxxxxxx xxx xxxxxxx xxxxxxxxxxx xxxxx xxxxxx xxxxxxxxx xxx xxxx xxxx xx xxxxxxxxxxx xxxxxx xxxx xx xxxx.</strong></p>
<p>xx xxxx xx xxxxxx xxxx xx xxxxxx xxxxxxxxxx, xx x xxxxxxxx xxx xxxxxxx xxxxxxxxxxx xxxxx xxxxxx xxxxxxxxx xxx xxxx xxxx xx xxxxxxxxxxx xxxxxx xxxx xx xxxx.</p>
<p>xx xxxx xx xxxxxx xxxx xx xxxxxx xxxxxxxxxx, xx x xxxxxxxx xxx xxxxxxx xxxxxxxxxxx xxxxx xxxxxx xxxxxxxxx xxx xxxx xxxx xx xxxxxxxxxxx xxxxxx xxxx xx xxxx.</p>
<p><strong>Xxxx xxxx xx xxxxxx xxxx xx xxxxxx xxxxxxxxxx, xx x xxxxxxxx xxx xxxxxxx xxxxxxxxxxx xxxxx xxxxxx xxxxxxxxx xxx xxxx xxxx xx xxxxxxxxxxx xxxxxx xxxx xx xxxx..</strong></p>
<h3 class="extra-padding">Xxxxxxx xx…</h3>
<h4>Xxx xxxxxxxxxx xx xxx Xxxx Xxxx Xxxxxxx Xxxxxx xxxxxxxx xxxx xxxxxx xxxx</h4>
<h4>Xxx xxxxxxxxxx xx xxx Xxxx Xxxx Xxxxxxx Xxxxxx xxxxxxxx xxxx xxxxxx xxxx</h4>
</div>
<div id="main-content-2" class="clearfix">
<h4> </h4>
</div>
</div><!-- end maincontent -->
<div id="bottom-content">
<div id="about-div">
<h2>Xxxxx xx…</h2>
<p>Xx, xx xxxxx ixx Xxxxxx Xxxxxxxxx xxxx xxxx xxxx xxxxxxx xxx xxxxxxxx xxxx xxxxxxx xxx xxxx xxxxxx xxxx xxxxx.</p>
<p>Xx, xx xxxxx ixx Xxxxxx Xxxxxxxxx xxxx xxxx xxxx xxxxxxx xxx xxxxxxxx xxxx xxxxxxx xxx xxxx xxxxxx xxxx xxxxxXx, xx xxxxx ixx Xxxxxx Xxxxxxxxx xxxx xxxx xxxx xxxxxxx xxx xxxxxxxx xxxx xxxxxxx xxx xxxx xxxxxx xxxx xxxxx</p>
<p>Xx, xx xxxxx ixx Xxxxxx Xxxxxxxxx xxxx xxxx xxxx xxxxxxx xxx xxxxxxxx xxxx xxxxxxx xxx xxxx xxxxxx xxxx xxxxx</p>
<div class="about-bottom-to-top">
<p><a href="#header">[Back to Top]</a></p>
</div>
</div>
<hr />
<div id="links-div">
<h2>Xxxxxx xxxxx...</h2>
<ul>
<li><a href="">Xxx Xxxxx xxxx xxx xxx xxx xx(?)</a></li>
<li><a href="">Xxx Xxxxx xxxx xxx xxx xxx xx(?)</a></li>
<li><a href="">Xxx Xxxxx xxxx xxx xxx xxx xx(?)</a></li>
<li><a href="">Xxx Xxxxx xxxx xxx xxx xxx xx(?)</a></li>
<li><a href="">Xxx Xxxxx xxxx xxx xxx xxx xx(?)</a></li>
<li><a href="">Xxx Xxxxx xxxx xxx xxx xxx xx(?)</a></li>
<li><a href="">Xxx Xxxxx xxxx xxx xxx xxx xx(?)</a></li>
<li><a href="">Xxx Xxxxx xxxx xxx xxx xxx xx(?)</a></li>
<li><a href="">Xxx Xxxxx xxxx xxx xxx xxx xx(?)</a></li>
<li><a href="">Xxx Xxxxx xxxx xxx xxx xxx xx(?)</a></li>
</ul>
</div>
<div id="contact-div">
<h2>Xxxxxx xxx...</h2>
<p>Xxxxx x xxxx xxx xxx xxxxxxxxxx xxx xxxxxxx x xxxx xxx xxx xxxxxxxxxx xxx xxx xxxx x xxxx xxx xxx xxxxxxxxxx xxx xxxxxxx x xxxx xxx xxx xxxxxxxxxx xxx xxx<br />
</p>
<p class="phone">Xxxxx</p>
</div>
<div id="form-div">
<p>Please make sure you complete all three fields below so that we can reply directly.</p>
<?php
if ($_POST && isset($missing) && !empty($missing))
?>
<p class="warning">Please complete the missing item(s) indicated.</p>
<?php
elseif ($_POST && !$mailSent) {
?>
<p class="warning">Sorry, there was a problem sending your message.
Please try later.</p>
<?php
elseif ($_POST && $mailSent) {
?>
<p class="thanks"><strong>Your message has been sent. Thank you for your feedback.
</strong></p>
<?php } ?>
<form method="post" id="feedback" class="contactForm" action="">
<label for="name">Name: <?php
if (isset($missing) && in_array('name', $missing)) { ?>
<span class="warning">Please enter your name</span><?php } ?>
</label>
<input name="name" id="name" type="text" class="formbox"
<?php if (isset($missing)) {
echo 'value="'.htmlentities($_POST['name']).'"';
} ?>
/>
<label for="email">Email: <?php
if (isset($missing) && in_array('email', $missing)) { ?>
<span class="warning">Please enter a valid email address</span><?php } ?>
</label>
<input name="email" id="email" type="text" class="formbox"
<?php if (isset($missing)) {
echo 'value="'.htmlentities($_POST['email']).'"';
} ?>
/>
<label for="comments">Comments: <?php
if (isset($missing) && in_array('comments', $missing)) { ?>
<span class="warning">Please enter your comments</span><?php } ?>
</label>
<textarea name="comments" id="comments" cols="30" rows="10"><?php
if (isset($missing)) {
echo htmlentities($_POST['comments']);
} ?></textarea>
<input name="send" id="send" class="formSubmit" type="submit" value="Send message" />
</form>
<div class="form-bottom-to-top">
<p><a href="#header">[Back to Top]</a></p>
</div>
</div>
</div>
<div id="footer">
<p>Xxxxxxxxxxxxx</p>
</div>
</div><!-- wrapper -->
</div>
<!-- end page-content -->
</div><!-- end wrapper -->
</body>
</html>
/* following is the include php code */
<?php
function nukeMagicQuotes() {
if (get_magic_quotes_gpc()) {
function stripslashes_deep($value) {
$value = is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value);
return $value;
$_POST = array_map('stripslashes_deep', $_POST);
$_GET = array_map('stripslashes_deep', $_GET);
$_COOKIE = array_map('stripslashes_deep', $_COOKIE);
?>
/* Following is the css */
@charset "UTF-8";
/* CSS Document */
html { margin: 0; background: #faf9f2 url(im/background_texture_tile.jpg) top center repeat; text-align: center; }
body { margin: 0 auto; background: url(im/background_texture_tile.jpg) top center repeat; text-align: center; width: 910px;
padding: 0; font: 62.5% Arial, Verdana, Helvetica, sans-serif; }
h1, h2, h3, h4, h5, h6, p, ul, ol, li, dl, dt, dd, form, label, fieldset, legend, blockquote, table { margin: 0; padding: 0; }
#wrapper {
text-align: left;
position: relative;
.container{
margin: 0 auto 0;
width: 910px;
#header {
width: 870px;
height: 150px;
margin: 0 20px 20px 20px ;
background: url(im/header-bg.gif) top left no-repeat;
h1.logo {
float: left;
height: 130px;
width: 315px;
margin: 0 0 0 50px;
border: 0;
outline: 0;
text-indent:-9999px;
background:url(im/logo.jpg) 0 10px no-repeat;
display: inline;
h2.subhead {
font-weight: bold;
font-size: 1.6em;
line-height: 1.4em;
color: #999;
float: right;
width: 135px;
text-align: right;
margin: 25px 320px 0 0;
display: inline;
#nav {
position: absolute;
top: 0px;
right: 50px;
width: 270px;
height: 277px;
background: url(im/nav-bg.png) top left no-repeat;
#nav h2 {
font-size: 1.6em;
text-align: center;
color: #4D98C5;
margin-top: 35px;
#nav h3 {
font-size:2.2em ;
text-align: center;
color: #4D98C5;
padding-bottom: 13px;
margin: 0 40px 0;
border-bottom: 4.5px dotted #999;
#nav ul {list-style:none;}
#nav li {
list-style:none;
font-size: 1.4em;
font-weight: bold;
margin: 0 40px 0 40px ;
border-bottom: 4.5px dotted #999;
#nav li a {
text-align: left;
background-image:url(im/CSSSprite.jpg);
background-repeat:no-repeat;
color: #4D98C5;
text-decoration: none;
line-height: 65px;
margin: 10px 0 10px 0;
#nav li a.nav-about {
background-position: 105px -15px;
padding: 20px 95px 20px 0;
#nav li a.nav-about:hover,
#nav li a.nav-about:active,
#nav li a.nav-about:focus {
background-position: 105px -102px;
color: #814098;
#nav li a.nav-contact {
background-position: 105px -180px;
padding: 20px 80px 20px 0;
#nav li a.nav-contact:hover,
#nav li a.nav-contact:active,
#nav li a.nav-contact:focus {
background-position: 105px -267px;
color: #814098;
/* Cycle styles */
#cycle {
float: left;
margin-left: 20px;
margin-bottom: 25px;
width: 547px;
height: 339px;
clear: both;
.pics { height: 339px; width: 547px; padding:0; margin:0; overflow: hidden; border: 1px solid #814098; }
/* End cycle styles */
/*///// RIGHT CONTENT ////*/
#right-column {
float: right;
width: 260px;
margin: 0 53px 0 0;
display: inline;
#ladies {
width: 252px;
height: 437px;
background: url(im/pink-ladies.png) top left no-repeat !important ;
background: url(im/pink-ladies.gif) top left no-repeat ;
margin: 120px 0 0 6px;
#ladies h1 {
margin: 0px 30px 150px 20px;
padding-top: 60px;
font: bold 2em Georgia, "Times New Roman", Times, serif;
text-align: center;
color: #6A437E;
#ladies p {
margin: 0px 30px 15px 20px;
font: normal 1.8em Georgia, "Times New Roman", Times, serif;
text-align: center;
line-height: 1.4em;
color: #EF4358;
#ladies p.bottom {
margin: 0px 30px 0px 20px;
font: bold 2.2em Helvetica, Arial, sans-serif;
text-align: center;
color: #6A437E;
#courses{
margin-top: 15px;
margin-bottom: 18px;
#courses h2 {
letter-spacing: .07em;
/*Hull Course */
#course1 {
margin: 0 0 5px 6px ;
width:240px;
background:url(im/rightnav.gif) bottom left no-repeat;
#course1 h2.top {
background:url(im/rightnaw.gif) top left no-repeat;
margin:0;
padding:15px;
color:#FFFFFF;
font-size:1.6em;
line-height: 1.4em;
font-weight: bold;
text-transform:uppercase;
#course1 h2 {
font-size:1.6em;
line-height: 1.4em;
color:#FFFFFF;
background-color:#814198;
padding:15px;
text-transform:uppercase;
#course1 p {
font-size:1.4em;
line-height:1.4em;
padding: 15px 15px 0 15px;
margin:0;
#course1 p a {
text-decoration:underline;
font-weight:bold;
color: #9f1f63
#course1 p a:hover {
color: #ec008c;
#course1 ul {
margin: 20px 0 20px 15px;
font-size:1.4em;
line-height: 1.6em;
list-style: none;
#course1 p.book-early {
padding-bottom: 20px;
#course1 p.location {
padding-bottom: 30px;
#course1 p.structure {
padding-bottom: 30px;
#course1 p.news {
padding-bottom: 30px;
#right-column .to-top {
color: #000;
text-align: right;
padding-right: 27px;
margin-bottom: 40px;
#right-column .to-top a, a:link {
color: #000;
font-size: 1.3em;
text-decoration: none;
#right-column .to-top a:hover {
text-decoration: underline;
#course2 {
margin: 0 0 5px 6px ;
width:240px;
background:url(im/rightnav.gif) bottom left no-repeat;
#course2 h2.top {
background:url(im/rightnaw.gif) top left no-repeat;
margin:0;
padding:15px;
color:#FFFFFF;
font-size:1.6em;
line-height: 1.4em;
font-weight: bold;
text-transform:uppercase;
#course2 h2 {
font-size:1.6em;
line-height: 1.4em;
color:#FFFFFF;
background-color:#814198;
padding:15px;
text-transform:uppercase;
#course2 p {
font-size:1.4em;
line-height:1.4em;
padding: 15px 15px 0 15px;
margin:0;
#course2 p a {
text-decoration:underline;
font-weight:bold;
color: #9f1f63
#course2 p a:hover {
color: #ec008c;
#course2 ul {
margin: 20px 0 20px 15px;
font-size:1.4em;
line-height: 1.6em;
list-style: none;
#course2 p.book-early {
padding-bottom: 20px;
#course2 p.location {
padding-bottom: 30px;
#course2 p.news {
padding-bottom: 30px;
/*///// RIGHT CONTENT ////*/
#main-content {
margin: 0 360px 0 40px;
padding: 0;
#main-content-1 {
width: 510px;
#main-content-2 {
width: 510px;
#main-content p {
font-family: Arial, Verdana, Helvetica, sans-serif;
font-size: 1.6em;
line-height: 1.4em;
padding-bottom: 1em;
color: #666;
#main-content h2{
padding: 0 0 20px 0;
margin: 0;
font-family: Arial, Verdana, Helvetica, sans-serif;
font-size: 3em;
color: #666;
#main-content h3 {
font-size: 2.3em;
color: #666;
font-weight: normal;
padding-bottom: 0.8em;
#main-content h3.extra-padding {
padding-top: 0.8em;
padding-bottom: 0.8em;
#main-content h4 {
font-size: 2em;
font-weight: normal;
#bottom-content {
background-color: #814098;
clear: both;
margin: 0 20px;
width: 870px;
float: left;
#bottom-content h2 {
font-family: Arial, Verdana, Helvetica, sans-serif;
font-size: 2.6em;
letter-spacing: .05em;
color: #FFF;
font-style: normal;
padding: 0 0 15px 0;
#bottom-content p {
color: #FFF;
#about-div {
padding: 0 320px 30px 0;
background: url(im/sheila.png) 560px 20px no-repeat !important;
background: url(im/sheila.jpg) 560px 20px no-repeat ;
#about-div h2 {
padding: 20px 28px 15px 28px;
#about-div p {
padding: 0 28px 20px 28px;
font-size: 1.5em;
line-height: 1.4em;
.about-bottom-to-top {
position: relative;
top: 65px;
right: -320px;
text-align: right;
padding-right: 33px;
font-size: .68em;
.about-bottom-to-top a, a:link {
color: #FFF;
text-decoration: none;
.about-bottom-to-top a:hover {
text-decoration: underline;
hr {
margin: 40px 28px 20px 28px;
color: #C09FCB;
border-top: 1px black solid;
#links-div {
margin: 0 15px 0px 28px;
float: left;
width: 254px;
#links-div li {
list-style: none;
padding: 0 0;
#links-div li a {
font-size:1.5em;
line-height: 1.5em;
text-decoration: none;
color: #FFF;
#links-div li a:hover {
text-decoration: underline;
#contact-div {
margin: 0 10px 0 0;
width: 254px;
float: left;
#contact-div p {
font-size: 1.5em;
line-height: 1.4em;
#contact-div p.phone {
font-size: 2.2em;
font-weight: bold;
letter-spacing: .05em;
/* CONTACT FORM */
#form-div {
margin: 0 28px 50px 0 ;
float: right;
width: 281px;
#form-div .contactForm {
padding:6px;
#form-div .contactForm .formbox {
font-family: Arial, Verdana, Helvetica, sans-serif;
font-size:1.2em;
color:#333;
width:261px;
padding:5px 3px;
margin:0 0 5px 0 ;
border:1px solid #666;
border-top-color:#000;
background:#fff url(im/contact-input.gif) top repeat-x;
#form-div .contactForm #comments {
font-family: Helvetica, Arial, sans-serif;
font-size:1.23em;
color:#333;
line-height: 1.5em;
width:258px;
padding: 5px 0.4em 0 0.4em ;
margin: 0 0 10px 0 ;
display:block;
clear:both;
border:1px solid #666;
border-top-color:#000;
background:#fff url(im/contact-textarea.gif) top repeat-x;
.formSubmit {
display:block;
clear:both;
width:110px;
height:25px;
padding:0;
border:none;
background-color: #251149;
text-align:center;
font-size:1.2em;
color:#fff;
cursor:pointer;
.formSubmit:hover {
background-color: #E76F34;
.form-bottom-to-top {
text-align: right;
padding-right: 33px;
font-size: 0.68em;
margin-top: 40px;
.form-bottom-to-top a, a:link {
color: #FFF;
text-decoration: none;
.form-bottom-to-top a:hover {
text-decoration: underline;
/* David Powers styles */
.warning {
font-weight: bold;
font-size: 1em;
color: #FCCCB9;
display: block;
.thanks {
font-weight: bold;
color: #f00;
margin-left: 3px;
#form-div p {
margin: 0 0 10px 8px ;
font-size: 1.5em;
line-height: 1.4em;
label {
font-weight: bold;
font-size: 1.6em;
color: #FFF;
display: block;
/* END CONTACT FORM */
#footer {
height: 10em;
background-color: #FFF;
margin: 0 20px;
clear: both;
#footer p {
font-size: 1.4em;
color: #666;
padding: 40px 0 30px 120px;
background: url(im/footer-logo.gif) 50px 20px no-repeat ;
.clearfix:after{ content:"."; display:block; height:0; clear:both; visibility:hidden; }
.clearfix {display: inline-block;}
/* Hide from IE Mac \*/
.clearfix {display:block;}
/* End hide from IE Mac */
* html .clearfix{ height: 1px; } -
Outlook pops out on form submit
I am making a form on Dreamweaver CC and I want to integrate that form in a Muse website and when I click submit, a window from Outlook pops out to send an e-mail to the recieptient e-mail.
I already read here but I don't know if I can integrate a PHP script with Adobe Muse files on my server. Would they enter in conflict or that's fine?
This is the code of the form:
<form action="mailto:[email protected]" method="get" enctype="text/plain" name="form1">
<p>
<label for="textfield"><strong>Name:</strong></label>
<input type="text" name="textfield" id="textfield">
<label for="email"><strong>Email:</strong></label>
<input type="email" name="email" id="email">
</p>
<p>
<label for="textfield2"><strong><br>
PICK-UP<br>
<br>
Location:</strong></label>
<input type="text" name="textfield2" id="textfield2">
<label for="date"><strong>Date:</strong></label>
<input type="date" name="date" id="date">
<label for="time"><strong>Time:</strong></label>
<input type="time" name="time" id="time">
</p>
<p>
<label for="textfield3"><strong><br>
DROP-OFF<br>
<br>
Location:</strong></label>
<input type="text" name="textfield3" id="textfield3">
<label for="date2"><strong>Date:</strong></label>
<input type="date" name="date2" id="date2">
<label for="time2"><strong>Time:</strong></label>
<input type="time" name="time2" id="time2">
</p>
<p>
<label for="textfield4"><strong><br>
Type of Car:</strong></label>
<input type="text" name="textfield4" id="textfield4">
</p>
<p>
<label for="textarea"><strong><br>
Notes/Extras:</strong> <em>(i.e.: GPS, Baby Seat, etc...)</em><br>
</label>
<textarea name="textarea" id="textarea" cols="45" rows="5"></textarea>
</p>
<p> </p>
<p>
<input name="submit" type="submit" id="submit" formaction="Submit Form" formmethod="GET" value="Send">
</p>
</form>
Waiting an answer.
Best wishes,
MiguelMailto: links on form submit are not reliable for several reasons.
Most web mail users do not have Outlook or similar e-mail clients installed on their system. When they click your submit button, nothing will happen.
Mailto: links do not hide your e-mail address from harvesters and spam bots.
Your form is not secure from spam bots and hackers.
AFAIK, Muse does not support server-side scripting. But that shouldn't preclude you from using a contact form with a separate form-to-email processing script. You point your HTML form to the script using the action attribute.
<form action="your_script.php"
Which script depends on your server. Ask your hosting provider if they have scripts you can use. If they don't, find out which server-side languages your hosting plan supports -- php, asp.net, coldfusion, perl, etc...
This will narrow your search form appropriate scripts you can use.
Nancy O. -
Where is the PDF file generated by the form submit?
I am designing a form with Adobe Acrobat Pro X that will be filled in on the web. So I've got a Submit button on it set to Submit a form, being sent to a URL (an html file), and I have checked (under Export Format) PDF The complete document.
So where is this exported PDF file once a user has submitted the filled-in form?
How can my html file find this PDF file?
I don't see where you define the location for these PDF files to go. I haven't been able to find a repository with these PDF files in them. And I can't find any info on the web.Thanks - yes, that's right.
I've been working on php code to get the data sent by the form, save it to a file and send an email with the file as an attachment.
If I set the form submit button in the AA form to send the data in fdf format, the php file only seems to get header info. If I send using pdf format, it gets pages and pages of code and symbols. Nothing I can parse.
Can't figure out how to save these pages and pages of code and symbols to a file and not very confident that if I did manage to and send them as an email attachment that they would ever reformat themselves to become a readable PDF.
All I want to do is send the filled-out form as a PDF attachment to an email. I don't care about the fields or the data - I just want the PDF.
And, no, I don't want to use the submit form to email feature because it is clunky. -
Need help with PHP contact form
Hi guys,
I've made a PHP contact form for my site and need help with a couple of things:
The form action links an external PHP script (scripts/contact-form-script.php) but is there a way I can have it so the PHP script for the form is contained within the same PHP file as my contact form (contact.php)?
I tried just putting the form code at the top of contact.php but the browser automatically reads the anti-spam re-direct, so maybe that needs revising too?
The second thing is, how can I make the Name, Email and Message fields mandatory? So if a user tries to submit the form and hasn't filled in one of the required fields and clicks submit, contact.php reloads with a message at the top of the form saying something like 'Complete the required fields' and highlights the relevant field with a red border?
Here's the code for contact.php:
<form action="http://www.mydomain.com/scripts/contact-form-script.php" method="post" name="contact" id="contact">
<p><strong>Name:*</strong><br />
<input name="name" type="text" class="ctextField" /></p>
<p><strong>E-mail:*</strong><br />
<input name="email" type="text" class="ctextField" /></p>
<p><strong>Telephone:</strong><br />
<input name="telephone" type="text" class="ctextField" /></p>
<p><strong>Company:</strong><br />
<input name="company" type="text" class="ctextField" /></p>
<p><strong>Address:</strong><br />
<input name="address1" type="text" class="ctextField" /></p>
<p><input name="address2" type="text" class="ctextField" /></p>
<p><strong>Town:</strong><br />
<input name="town" type="text" class="ctextField" /></p>
<p><strong>County:</strong><br />
<input name="county" type="text" class="ctextField" /></p>
p><strong>Postcode:</strong><br />
<input name="postcode" type="text" class="ctextField" /></p>
<p><strong>Message:*</strong><br />
<textarea name="message" cols="55" rows="8" class="ctextField"></textarea></p>
<p><input name="submit" value="SEND MESSAGE" class="submitButton" type="submit" /><div style="visibility:hidden; width:1px; height:1px"><input name="url" type="text" size="45" id="url" /></div></p>
</form>
And this is the PHP I'm using to submit the form data for contact-form-script.php:
<?php
$headers .= "Reply-To: " . $_POST["email"] . "\r\n";
$to = "[email protected]";
$subject = "Contact from website";
$message = $headers;
$message .= "Name: " . $_POST["name"] . "\r\n";
$message .= "E-mail: " . $_POST["email"] . "\r\n";
$message= '
<table cellspacing="0" cellpadding="8" border="0" width="500">
<tr>
<td colspan="2"></td>
</tr>
<tr bgcolor="#eeeeee">
<td width="154" style="font-family:Verdana, Arial; font-size:11px; color:#333333;"><strong>Name</strong></td>
<td width="314" style="font-family:Verdana, Arial; font-size:11px; color:#333333;">'.$name.'</td>
</tr>
<tr bgcolor="#eeeeee">
<td style="font-family:Verdana, Arial; font-size:11px; color:#333333;"><strong>E-mail address:</strong></td>
<td style="font-family:Verdana, Arial; font-size:11px; color:#333333;">'.$email.'</td>
</tr>
<tr bgcolor="#eeeeee">
<td style="font-family:Verdana, Arial; font-size:11px; color:#333333;"><strong>Telephone number:</strong></td>
<td style="font-family:Verdana, Arial; font-size:11px; color:#333333;">'.$telephone.'</td>
</tr>
<tr bgcolor="#eeeeee">
<td style="font-family:Verdana, Arial; font-size:11px; color:#333333;"><strong>Company:</strong></td>
<td style="font-family:Verdana, Arial; font-size:11px; color:#333333;">'.$company.'</td>
</tr>
<tr bgcolor="#eeeeee">
<td style="font-family:Verdana, Arial; font-size:11px; color:#333333;"><strong>Address</strong></td>
<td style="font-family:Verdana, Arial; font-size:11px; color:#333333;">'.$address1.'</td>
</tr>
<tr bgcolor="#eeeeee">
<td></td>
<td style="font-family:Verdana, Arial; font-size:11px; color:#333333;">'.$address2.'</td>
</tr>
<tr bgcolor="#eeeeee">
<td style="font-family:Verdana, Arial; font-size:11px; color:#333333;"><strong>Town</strong></td>
<td style="font-family:Verdana, Arial; font-size:11px; color:#333333;">'.$town.'</td>
</tr>
<tr bgcolor="#eeeeee">
<td style="font-family:Verdana, Arial; font-size:11px; color:#333333;"><strong>County</strong></td>
<td style="font-family:Verdana, Arial; font-size:11px; color:#333333;">'.$county.'</td>
</tr>
<tr bgcolor="#eeeeee">
<td style="font-family:Verdana, Arial; font-size:11px; color:#333333;"><strong>Postcode</strong></td>
<td style="font-family:Verdana, Arial; font-size:11px; color:#333333;">'.$postcode.'</td>
</tr>
<tr bgcolor="#eeeeee">
<td colspan="2" style="font-family:Verdana, Arial; font-size:11px; color:#333333;"><strong>Message</strong></td>
</tr>
<tr bgcolor="#eeeeee">
<td colspan="2" style="font-family:Verdana, Arial; font-size:11px; color:#333333;">'.$message.'</td>
</tr>
<tr><td colspan="2" style="padding:0px;"><img src="images/whitespace.gif" alt="" width="100%" height="1" /></td></tr>
</table>
$url = stripslashes($_POST["url"]);
if (!empty($url)) {
header( 'Location: http://www.go-away-spam-robots.com' );
exit();
mail($to, $subject, $message, $headers);
header( 'Location: http://www.mydomain.com/sent.php' ) ;
?>
Any help on this would be greatly appreciated.
Thank you and I hope to hear from you!
SMRevised code with form validation for Name Email and Message:
<?php
if (array_key_exists('submit', $_POST)) {
$name = $_POST['name'];
$email = $_POST['email'];
$telephone = $_POST['telephone'];
$company = $_POST['company'];
$address1 = $_POST['address1'];
$address2 = $_POST['address2'];
$town = $_POST['town'];
$county = $_POST['county'];
$postcode = $_POST['postcode'];
$formMessage = $_POST['message'];
if (empty($name)) {
$warning['name'] = "Please provide your name";
if (empty($email)) {
$warning['email'] = "Please provide your email";
if (empty($formMessage)) {
$warning['message'] = "Please provide your message";
$headers .= "Reply-To: " . $_POST["email"] . "\r\n";
$to = "[email protected]";
$subject = "Contact from website";
$message = $headers;
$message .= "Name: " . $_POST["name"] . "\r\n";
$message .= "E-mail: " . $_POST["email"] . "\r\n";
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$message= "
<table cellspacing='0' cellpadding='8' border='0' width='500'>
<tr>
<td colspan='2'></td>
</tr>
<tr bgcolor='#eeeeee'>
<td width='154' style='font-family:Verdana, Arial; font-size:11px; color:#333333;'><strong>Name</strong></td>
<td width='314' style='font-family:Verdana, Arial; font-size:11px; color:#333333;'>".$name."</td>
</tr>
<tr bgcolor='#eeeeee'>
<td style='font-family:Verdana, Arial; font-size:11px; color:#333333;'><strong>E-mail address:</strong></td>
<td style='font-family:Verdana, Arial; font-size:11px; color:#333333;'>".$email."</td>
</tr>
<tr bgcolor='#eeeeee'>
<td style='font-family:Verdana, Arial; font-size:11px; color:#333333;'><strong>Telephone number:</strong></td>
<td style='font-family:Verdana, Arial; font-size:11px; color:#333333;'>".$telephone."</td>
</tr>
<tr bgcolor='#eeeeee'>
<td style='font-family:Verdana, Arial; font-size:11px; color:#333333;'><strong>Company:</strong></td>
<td style='font-family:Verdana, Arial; font-size:11px; color:#333333;'>".$company."</td>
</tr>
<tr bgcolor='#eeeeee'>
<td style='font-family:Verdana, Arial; font-size:11px; color:#333333;'><strong>Address</strong></td>
<td style='font-family:Verdana, Arial; font-size:11px; color:#333333;'>".$address1."</td>
</tr>
<tr bgcolor='#eeeeee'>
<td></td>
<td style='font-family:Verdana, Arial; font-size:11px; color:#333333;'>".$address2."</td>
</tr>
<tr bgcolor='#eeeeee'>
<td style='font-family:Verdana, Arial; font-size:11px; color:#333333;'><strong>Town</strong></td>
<td style='font-family:Verdana, Arial; font-size:11px; color:#333333;'>".$town."</td>
</tr>
<tr bgcolor='#eeeeee'>
<td style='font-family:Verdana, Arial; font-size:11px; color:#333333;'><strong>County</strong></td>
<td style='font-family:Verdana, Arial; font-size:11px; color:#333333;'>".$county."</td>
</tr>
<tr bgcolor='#eeeeee'>
<td style='font-family:Verdana, Arial; font-size:11px; color:#333333;'><strong>Postcode</strong></td>
<td style='font-family:Verdana, Arial; font-size:11px; color:#333333;'>".$postcode."</td>
</tr>
<tr bgcolor='#eeeeee'>
<td colspan='2' style='font-family:Verdana, Arial; font-size:11px; color:#333333;'><strong>Message</strong></td>
</tr>
<tr bgcolor='#eeeeee'>
<td colspan='2' style='font-family:Verdana, Arial; font-size:11px; color:#333333;'>".$formMessage."</td>
</tr>
<tr><td colspan='2' style='padding: 0px;'><img src='images/whitespace.gif' alt='' width='100%' height='1' /></td></tr>
</table>
$url = stripslashes($_POST["url"]);
if (!empty($url)) {
header( 'Location: http://www.go-away-spam-robots.com' );
exit();
if (!isset($warning)) {
mail($to, $subject, $message, $headers);
header( 'Location: http://www.mydomain.com/sent.php' ) ;
?>
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
<style type="text/css">
p {
margin: 0;
padding: 10px 0 0 0;
.warning {
color:#C00;
</style>
</head>
<body>
<form action="" method="post" name="contact" id="contact">
<p><strong>Name:*</strong><br />
<input name="name" <?php if (isset($warning['name'])) { echo "style='border: 1px solid #C00'"; } ?> type="text" class="ctextField" />
<?php if (isset($warning['name'])) { echo "<p class='warning'>".$warning['name']."</p>"; }?>
</p>
<p><strong>E-mail:*</strong><br />
<input name="email" <?php if (isset($warning['email'])) { echo "style='border: 1px solid #C00'"; } ?>type="text" class="ctextField" />
<?php if (isset($warning['name'])) { echo "<p class='warning'>".$warning['email']."</p>"; }?>
</p>
<p><strong>Telephone:</strong><br />
<input name="telephone" type="text" class="ctextField" /></p>
<p><strong>Company:</strong><br />
<input name="company" type="text" class="ctextField" /></p>
<p><strong>Address:</strong><br />
<input name="address1" type="text" class="ctextField" /></p>
<p><input name="address2" type="text" class="ctextField" /></p>
<p><strong>Town:</strong><br />
<input name="town" type="text" class="ctextField" /></p>
<p><strong>County:</strong><br />
<input name="county" type="text" class="ctextField" /></p>
<p><strong>Postcode:</strong><br />
<input name="postcode" type="text" class="ctextField" /></p>
<p><strong>Message:*</strong><br />
<?php if (isset($warning['message'])) { echo "<p class='warning'>".$warning['message']."</p>"; }?>
<textarea name="message" <?php if (isset($warning['message'])) { echo "style='border: 1px solid #C00'"; } ?> cols="55" rows="8" class="ctextField"></textarea></p>
<p><input name="submit" value="SEND MESSAGE" class="submitButton" type="submit" /><div style="visibility:hidden; width:1px; height:1px"><input name="url" type="text" size="45" id="url" /></div></p>
</form>
</body>
</html> -
Hi all,
I'm trying to use a php Contact form and it's throwing up an error even before I click submit. As a newbie to PHP I don't really know where I am going wrong.
Here's the link to the contact form.
http://www.thesketchcollective.co.uk/clients/form-example/myform1.php
Secondly, I would also like the form to send an email as well as send the info to CSV format. It currently just sends it to a CSV.
Any help would be appreciated.
Cheers
Tom<?php
if($_POST['formSubmit'] == "Submit")
$errorMessage = "";
if(empty($_POST['formMovie']))
$errorMessage .= "<li>You forgot to enter a movie!</li>";
if(empty($_POST['formName']))
$errorMessage .= "<li>You forgot to enter a name!</li>";
$varMovie = $_POST['formMovie'];
$varName = $_POST['formName'];
if(empty($errorMessage))
$fs = fopen("mydata.csv","a");
fwrite($fs,$varName . ", " . $varMovie . "\n");
fclose($fs);
header("Location: thankyou.html");
exit;
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>My Form</title>
</head>
<body>
<?php
if(!empty($errorMessage))
echo("<p>There was an error with your form:</p>\n");
echo("<ul>" . $errorMessage . "</ul>\n");
?>
<form action="myform1.php" method="post">
<p>
What is your favorite movie?<br>
<input type="text" name="formMovie" maxlength="50" value="<?=$varMovie;?>" />
</p>
<p>
What is your name?<br>
<input type="text" name="formName" maxlength="50" value="<?=$varName;?>" />
</p>
<input type="submit" name="formSubmit" value="Submit" />
</form>
</body>
</html> -
PHP Email Form is not Emailing
HI,
I made a PHP email form and i was wondering if i did it
correct. I try to send a email but for some reason it wont work
here is the PHP code:
<?php
$emailSubject = 'Computer Question!';
$webMaster = '[email protected]';
$nameField = $_POST ['name'];
$phoneField = $_POST ['phone'];
$emailField = $_POST ['email'];
$questionField = $_POST ['question'];
$body = <<<EOD
<br><hr><br>
Name: $name <br>
Phone: $phone <br>
Email: $email <br>
Question: $question <br>
EOD;
$headers = "From: $email\r\n";
$headers .="Content=type: text/html\r\n";
$success = mail($webMaster, $emailSubject, $body, $headers);
/* Results Rendered as HTML */
$theResults = <<<EOD
?>
Here is the Email form:
:<!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>
<meta http-equiv="Content-Type" content="text/html;
charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<form id="form1" name="form1" method="post"
action="Contact form 505 test 2.php">
<table width="70%" border="1" cellpadding="6">
<tr>
<th width="16%" scope="col"><div align="right">
<label for="name">Name:</label>
</div></th>
<th width="84%" scope="col"><div align="left">
<input name="name" type="text" id="name" size="35"
maxlength="60" />
</div></th>
</tr>
<tr>
<th scope="row"><div align="right">
<label for="phone ">Phone Number</label>
</div></th>
<td><div align="left">
<input name="phone " type="text" id="phone " size="35"
maxlength="13" />
</div></td>
</tr>
<tr>
<th scope="row"><div align="right">
<label for="email">Email:</label>
</div></th>
<td><div align="left">
<input name="email" type="text" id="email" size="35"
maxlength="40" />
</div></td>
</tr>
<tr>
<th scope="row"><div align="right">
<label for="question">Question:</label>
</div></th>
<td><div align="left">
<textarea name="question" cols="26" rows="8"
id="question"></textarea>
</div></td>
</tr>
<tr>
<th scope="row"> </th>
<td><label for="Send Email"></label>
<input type="submit" name="Send Email" id="Send Email"
value="Submit" /></td>
</tr>
</table>
</form>
</body>
</html>
Any help would be appreciated!
thanks.oO(jumpman310)
> I made a PHP email form and i was wondering if i did it
correct. I try to send
>a email but for some reason it wont work here is the PHP
code:
Next time please be more specific. "won't work" isn't really
helpful.
Anyway, the first thing to fix is the error reporting on your
testing
server, obviously it's not configured properly. In your
php.ini these
directives have to be set:
error_reporting = E_ALL|E_STRICT
display_errors = on
You should get some notices from your script. After fixing
those issues,
you should also read about header injection and how to
prevent it. Your
script is vulnerable and can be abused for sending spam. Also
consider
to use a class like PHPMailer to make things more secure and
convenient.
Some further notes about your form markup:
* It's very good that you make use of labels for your form
controls, but
in some cases the IDs of these controls contain spaces, which
is not
allowed.
* You don't really need a label for a submit button.
* Consider to drop all those div elements in the table
headers - you
don't need them. Use CSS to style the labels the way you
want, e.g.
form th {text-align: right}
I also use this:
label:hover {outline: 1px dotted #666}
* Check the markup of the "Name" row. The 'scope' attribute
is incorrect
and the form control should be inside a 'td', not a 'th'.
Micha -
Increase in SPAM web form submissions
Hi,
I'm noticing a trend of increased SPAM web form submissions across most of our BC sites. This has got particularly bad in the past week or so. All SPAM submissions follow a very similar theme. The text is complete 'gobbledygook' basically! The forms being used don't have any description fields where long descriptions or links can be entered so I struggle to see why this is happening.
What I want to know is:
- is this something other BC partners are noticing, particularly recently
- are your SPAM submissions similar to what I have shown below
- what can we do to reduce these other than using CAPTCHA on all forms?
- we exclusively use BC but I would be interested to know if the BC platform is particularly bad for SPAM submissions or is this something all sites are suffering from nowadays?
- any other light you could shed on this issue or advice you could impart would be much appreciated
Real submission example:
First name: tjlavseb
Surname: tjlavseb
Email: [email protected]
Date: hgnhQMmssGynJLb
Time: 11am
House Name: LHkJxazHGUYClEZJQd
Street address: nvOaQumEsbBGsA
Postcode: lJEODtxlXjHi there,
We are experiencing a high volume of spam since changing our web forms on our newly redesigned site. The objective of the site design was to make it quick and easy for clients to get a quick quote thus asking for only a few fields to be completed. Adding a captcha form would actually detract from the purpose of the form.
We have implemented the honey pot field which seems to have made little to no difference in volume (this seems to be the case for this fix across many other users of BC). The problem is with our spam is quite unusual whereby we are not getting any specific info from them really making it hard to detect if it is spam or real. See example;
Have you seen this type before?
Your Name
David
Email Address
[email protected]
Case Number
4257685
Company
casterick
Date
18-Apr-2013
Location
Victoria
Type
Meeting
Your Requirements -
Dreamweaver Forms Submit button
I can not get the submit button to work on the Forms page I built. Is it true that some special code is needed from the website server to put this all together and make it work? If so, why doesn't it tell you that somewhere in the Dreamweaver tools. It seems it shouldn't have to be that hard to make it work. If there is an easier way to make it work, please let me know. All I get when I try it is an empty email comes up when I click Submit. There is no form included in it. I need to get this working on our website. Please help. Thanks.
Dreamweaver is a professional level tool, it assumes you understand the basics of html, css, javascript and some server scripting.
It's not terribly difficult to make a form function (using a mailto: link in the form's action attribute), it's only a bit more difficult to make it function securely, without opening your email address up to massive amounts of spam and causing half of your viewers to see nothing when clicking on the submit button.
Personally, I use the Formmail script from http://www.tectite.com it's fairly secure out of the box (and offers more security with reCapcha) and has a lot of features you can choose to use, or not. It's loads safer and much more reliable than attempting to use a mailto: link.
If your server supports PHP, I'd suggest trying it out. -
Feature Request / Form Submit
There are a couple of improvements I believe would make
Spry's "form submit" much better:
1. It needs to (optionally) clear input from each field upon
successful submittion (ie. return to default value). Of course this
behavior automatically happens with a normal html form. When form
is being used in a database application, clearing previously
entered data is counterproductive.
2. It would be nice if "form submit" reset cursor focus to
specified field upon submittion. Once again, this would help Spry
action resemble function of normal html form.
On my current application, I am still struggling with
resetting my form as described above. Any help would be
appreciated.This should do the trick:
<script type="text/javascript">
function resetForm(myForm){
myForm.reset();
</script>
<form name="
frmName" method="post" action="whatever.php"
onSubmit="return Spry.Utils.submitForm(this,
resetForm('frmName');">
Of course you can extend the functionality of the callback
function (resetForm) with other actions you would like to see
performed after the update has taken place.
Maybe you are looking for
-
How can i make an apple ID without any visa card?
How can i make an apple ID without any visa card? I don't wanna add my visa online. i just want to make a fast APPLE ID because me and a friend are using same Apple ID, and i wanna make a new one so... how?
-
After updating iWeb and republishing my 5 sites (non .Mac) my publish folder shrink from around 98 MB to 58 MB. Umm, that's pretty darn good. It really changed how it handled jpegs w/ reflection effects added (.png's) for example when posted online.
-
Weblogic as Service on Windows 2000
I am running a WLS as a service on a Windows 2000 server and have integrated Hibernate using EJBs. Hibernate relies on a config file residing in the application root directory. When run from the command prompt this config file can be found by WLS in
-
Tracks of album split into 2 albums
iTimes 11.1.3 -- some of my albums are split into sections that actually appear as if they are entirely separate albums. In all cases, these are albums that had been downloaded from iTunes Store (years ago). For example, I have 3 albums. For simplici
-
How do you install a trial version of Adobe Premier elements 11?
I downloaded a trial version of Adobe Premier Elements 11 and tran the install application that came with it. It's done but where is Adobe Premier Elements 11.