Help - Search - Members - Calendar
Full Version: Im Unsure If This Is The Right Place But I Need Help
Zymic Webmaster Forums > Web Design & Development > General Web Design Discussion
simentalove
So I was surfing youtube looking for some easy step by step tutorials to help me with dreamweaver and I cam across tutvid.com. I found it really easy and attempted to do a php scripting form which what ever the user places in the form when they hit the sumit button it should sent the information to me in a email right ....?
Well I followed it though EXCATLEY how he did it, went to test it and instead of it saying: Thank you for your email. blah blah blah which was what it was meant to say it asked me if I want to save it as a php file.
Can anyone show me what Ive done wrong??
Heres the vid: http://www.youtube.com/watch?v=rdsz9Ie6h7I
I have downloaded the two files he is using, the contactform.php (which has the form on it) and the htmpfromphp.html file (which displays the Thank you for your email bit).
Heres my code:
<?php

/* Subject and Email Variables */

$emailSubject = 'Crazy PHP Scripting!';
$webMaster = 'magical_simmers@yahoo.co.uk';

/* Gathering Data Variables */

$emailField = $_POST ['email'];
$nameField = $_POST ['name'];
$phoneField = $_POST ['phone'];
$budgetField = $_POST ['budget'];
$travelersField = $_POST ['travelers'];
$commentsField = $_POST ['comments'];
$newsletterField = $_POST ['newsletter'];


$body = <<<EOD
<br><hr><br>
Email: $email<br>
Name: $name<br>
Phone: $phone<br>
Budget: $budget<br>
Number of travelers: $travelers<br>
Comments: $comments<br>
Newsletter: $newsletter<br>
EOD;

$header = "From: $email\r\n";
$hearder .= "Content-type: text/html\r\n";
$success = mail($webMaster, $emailSubject, $body, $header);

/* Results rendered as HTML */


$theResults = <<<EOD
<html>
<head>
<title>JakesWorks - travel made easy-Homepage</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
body {
background-color: #f1f1f1;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
font-style: normal;
line-height: normal;
font-weight: normal;
color: #666666;
text-decoration: none;
}
-->
</style>
</head>

<div>
<div align="left">Thank you for your interest! Your email will be answered very soon!</div>
</div>
</body>
</html>
EOD;
echo "$theResults";

?>

Thank you for any help I really got into this last night and got excited by all the different forms and stuff and I can place on my webstie for my users.
Again sorry if this is in the wrong section
GRG blink.gif blink.gif blink.gif
swordz
The php mail function is disabled by default - this is to stop spammers using Zymic. However, it is possible to have it turned on by paying Jack $10, and you can do safe mode at the same time for $15. Go to the IRC Chat and talk to Jack if you want to.

Hope this helps,

swordz
simentalove
I havent even uploaded it to here I was just trying it out by pressing F12 to see what it looked like and if I got that email wacko.gif wacko.gif wacko.gif
swordz
Sorry - my mistake - I'd assumed you had it online!

I'm afraid I don't know enough about DreamWeaver to help you, sorry.

swordz
Brandon
QUOTE(swordz @ Aug 16 2008, 10:04 AM) *
The php mail function is disabled by default - this is to stop spammers using Zymic. However, it is possible to have it turned on by paying Jack $10, and you can do safe mode at the same time for $15. Go to the IRC Chat and talk to Jack if you want to.

Hope this helps,

swordz

Safe will not be turnt off anymore, only phpmail can be turnt on now.
Ed
QUOTE(simentalove @ Aug 16 2008, 10:46 AM) *
I havent even uploaded it to here I was just trying it out by pressing F12 to see what it looked like and if I got that email wacko.gif wacko.gif wacko.gif


It won't work unless you have a local server with php installed; additionally, you've written '$headers' wrong here:

CODE
$header = "From: $email\r\n";
$hearder .= "Content-type: text/html\r\n";


Also you should really strip "\n" and "\r" from the $email (or anything else going into a header) or you're susceptible to CRLF injections.

CODE
$email = str_replace(array("\n", "\r"), '', $email);
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.