You are here: Form Help « PHP Programming Language « IT news, forums, messages
Form Help

Posted by Hoopster on 06/24/06 13:49

Here is my form that I''m having problems with.

I just can't get an e-mail ???



<p><b class="yellow">Contact Us</b></p>
<form action="FormToEmail.php" method="post"
enctype="multipart/form-data">
<input class="sidebar" value="name" name="user" >
<input class="sidebar" value="email" name="email" > <TEXTAREA
class=sidebar name=content rows=40 cols=30></TEXTAREA>
<input class="button_sidebar" value="Send" type="submit" >
<input class="button_sidebar" value="Reset" type="reset" >
</form>





My FormToEmail.php looks like this:


<?php


*/

$my_email ="Johndoe@gmail.com";

/*

Enter the continue link to offer the user after the form is sent. If
you do not change this, your visitor will be given a continue link to
your homepage:

If you do change it, remove the "/" symbol below and replace with the
name of the page to link to, eg: "mypage.htm" or
"http://www.elsewhere.com/page.htm"

*/

$continue = "/";

/*

Step 3:

Save this file (FormToEmail.php) and upload it together with your
webpage to your webspace. IMPORTANT - The file name is case
sensitive! You must save it exactly as it is named above! Do not put
this script in your cgi-bin directory (folder) it may not work from
there.

THAT'S IT, FINISHED!

You do not need to make any changes below this line.

*/

// This line prevents values being entered in a URL

if ($_SERVER['REQUEST_METHOD'] != "POST"){exit;}

// Describe function to check for new lines.

function new_line_check($a)
{

if(preg_match('`[\r\n]`',$a)){header("location:
$_SERVER[HTTP_REFERER]");exit;}

}

new_line_check($_POST['Name']);

// Check for disallowed characters in the Name and Email fields.

$disallowed_name = array(':',';','"','=','(',')','{','}','@');

foreach($disallowed_name as $value)
{

if(stristr($_POST['Name'],$value)){header("location:
$_SERVER[HTTP_REFERER]");exit;}

}

new_line_check($_POST['Email']);

$disallowed_email = array(':',';',"'",'"','=','(',')','{','}');

foreach($disallowed_email as $value)
{

if(stristr($_POST['Email'],$value)){header("location:
$_SERVER[HTTP_REFERER]");exit;}

}

$message = "";

// This line prevents a blank form being sent, and builds the message.

foreach($_POST as $key =>
$value){if(!(empty($value))){$set=1;}$message = $message . "$key:
$value\n\n";} if($set!==1){header("location:
$_SERVER[HTTP_REFERER]");exit;}

$message = $message . "-- \nThank you for using FormToEmail from
http://FormToEmail.com";
$message = stripslashes($message);

$subject = "FormToEmail Comments";
$headers = "From: " . $_POST['Email'] . "\n" . "Return-Path: " .
$_POST['Email'] . "\n" . "Reply-To: " . $_POST['Email'] . "\n";

mail($my_email,$subject,$message,$headers);

?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

<head>

<title>Form To Email PHP script from FormToEmail.com</title>

<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<meta http-equiv="Content-Language" content="en-uk">

</head>

<body bgcolor="#ffffff" text="#000000">

<font face="arial">

<object><center>
<h1>Thank you <?php print stripslashes($_POST['Name']); ?>!</h1>
<h2>Your form has been sent</h2>
<h3><a href="<?php print "$continue"; ?>">Click here to
continue</a></h3>
<b>FormToEmail</b> by <a
href="http://FormToEmail.com">FormToEmail.com</a>
</center></object>

</font>

</body>
</html>










********** For some reason I just can't receive an e-mail.



Any help would be appreciated.


Thanks!

- hoopster

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация