guyz pls i need help writting d php script for a registration form...i want all the contents of the form to be emailed to an email address i will provide here is a copy of the html code, its juss the php script i need not pls someone help

<FORM name="Form" method="post" action="reg.html"id="Form" enctype="multipart/form-data" onsubmit="return validateForm(this)">

<TABLE cellspacing="0" cellpadding="0" width="100%" border="0">
<TBODY><TR>
<TD></TD>
</TR>
<TR>
<TD nowrap="" colspan="4">
<TABLE cellspacing="0" cellpadding="0" width="100%" border="0">

<TBODY><TR valign="top">

</TR>
</TBODY></TABLE></TD>
</TR>
<TR>
<TD colspan="4"><BR>&nbsp; </TD>

</TR>
<TR>
<TD colspan="4"><STRONG>Your Contact Information</STRONG></TD>
</TR>
<TR>
<TD bgcolor="#333333" colspan="4"><IMG height="1" src="./Model Registration Form_files/space.gif" width="1"></TD>
</TR>
<TR>
<TD nowrap=""><FONT color="#009900">E-Mail Address</FONT>:</TD>

<TD><INPUT name="Profile1:EMail" type="text" maxlength="80" id="Profile1_EMail" tabindex="5" class="textfield">
</TD>
<TD align="right"><FONT color="#009900">Telephone</FONT>:</TD>

<TD align="right"><INPUT name="Profile1:Telephone" type="text" maxlength="20" id="Profile1_Telephone" tabindex="7" class="textfield"></TD>
</TR>
<TR>
<TD valign="top" nowrap=""><FONT color="#009900">Repeat E-Mail</FONT>:</TD>
<TD valign="top"><INPUT name="Profile1:RepeatEMail" type="text" maxlength="80" id="Profile1_RepeatEMail" tabindex="6" class="textfield">

</TD>
<TD nowrap="" align="right"><FONT color="#009900">Alternate&nbsp;Phone</FONT>:</TD>

<TD align="right"><INPUT name="Profile1:AlternatePhone" type="text" maxlength="20" id="Profile1_AlternatePhone" tabindex="8" class="textfield"></TD>
</TR>
<TR>

<TD colspan="4"><BR>
&nbsp; </TD>
</TR>
<TR>
<TD colspan="4"><STRONG>About You</STRONG></TD>
</TR>
<TR>
<TD bgcolor="#333333" colspan="4"><IMG height="1" src="./Model Registration Form_files/space.gif" width="1"></TD>
</TR>
<TR>
<TD nowrap="">First Name:</TD>

<TD><INPUT name="Profile1:FirstName" type="text" maxlength="40" id="Profile1_FirstName" tabindex="9" class="textfield"></TD>
<TD align="right">Age:</TD>

<TD align="right"><INPUT name="Profile1:Age" type="text" maxlength="2" id="Profile1_Age" tabindex="11" class="textfield">

</TD>
</TR>
<TR>
<TD nowrap=""><FONT color="#009900">Last Name</FONT>:</TD>
<TD valign="top"><INPUT name="Profile1:LastName" type="text" maxlength="40" id="Profile1_LastName" tabindex="10" class="textfield"></TD>
<TD align="right">
<TD align="right">
</TR>
<TR>
<TD colspan="4"><BR>&nbsp;</TD>

</TR>
<TR>

<TD colspan="4"><STRONG>Where Do You Live</STRONG></TD>
</TR>
<TR>
<TD bgcolor="#333333" colspan="4"><IMG height="1" src="./Model Registration Form_files/space.gif" width="1"></TD>
</TR>
<TR>
<TD>City:</TD>
<TD><INPUT name="Profile1:City" type="text" maxlength="50" id="Profile1_City" tabindex="14" class="textfield">
</TD>
<TD align="right">Country:</TD>
<TD align="right"><INPUT name="Profile1:Country" type="text" maxlength="30" id="Profile1_Country" tabindex="16" class="textfield">
</TD>

</TR>

<TR>
<TD>State:<BR></TD>
<TD><INPUT name="Profile1:Province" type="text" maxlength="30" id="Profile1_Province" tabindex="15" class="textfield"></TD>
<TD align="right"><BR><FONT color="#009900">Postal Code</FONT>:</TD>
<TD align="right"><INPUT name="Profile1:PostalCode" type="text" maxlength="10" id="Profile1_PostalCode" tabindex="17" class="textfield"></TD>
</TR>
<TR>
<TD colspan="4"><BR>&nbsp;</TD>
</TR>
<TR>
<TD colspan="4"><STRONG>Physical Description</STRONG> (pls fill as it applies to you)</TD>

</TR>

<TR>
<TD bgcolor="#333333" colspan="4"><IMG height="1" src="./Model Registration Form_files/space.gif" width="1"></TD>
</TR>
<TR>
<TD>Height:</TD>
<TD><INPUT name="Profile1:Height" type="text" maxlength="15" id="Profile1_Height" tabindex="18" class="textfield"></TD>
<TD align="right">Bust Size:<BR></TD>
<TD align="right"><INPUT name="Profile1:BustSize" type="text" maxlength="15" id="Profile1_BustSize" tabindex="21" class="textfield"></TD>
</TR>
<TR>
<TD>Weight:</TD>
<TD><INPUT name="Profile1:Weight" type="text" maxlength="15" id="Profile1_Weight" tabindex="19" class="textfield"></TD>

<TD align="right">Waist Size:<BR></TD>

<TD align="right"><INPUT name="Profile1:WaistSize" type="text" maxlength="15" id="Profile1_WaistSize" tabindex="22" class="textfield"></TD>
</TR>
<TR>
<TD>Eye Color:</TD>
<TD><INPUT name="Profile1:EyeColor" type="text" maxlength="15" id="Profile1_EyeColor" tabindex="20" class="textfield"></TD>
<TD nowrap="" align="right">Hip Size:</TD>
<TD align="right"><INPUT name="Profile1:HipSize" type="text" maxlength="15" id="Profile1_HipSize" tabindex="23" class="textfield"></TD>
</TR>
<TR>
<TD colspan="4"><BR>
&nbsp;</TD>
</TR>

<TR>
<TD colspan="4"><STRONG>Qualifications</STRONG> (list related job experiences, duties, responsibilities, hobbies, etc...)</TD>

</TR>
<TR>
<TD bgcolor="#333333" colspan="4"><IMG height="1" src="./Model Registration Form_files/space.gif" width="1"></TD>
</TR>
<TR>
<TD valign="top" colspan="4"><TEXTAREA name="Profile1:Qualifications" id="Profile1_Qualifications" tabindex="24" class="textfield"></TEXTAREA></TD>
</TR><TR>
<TD colspan="4"><BR>
&nbsp;</TD>
</TR>

<TR>
<TD colspan="4"><STRONG>Personality</STRONG> (check all the traits that apply to you)</TD>
</TR>

<TR>
<TD bgcolor="#333333" colspan="4"><IMG height="1" src="./Model Registration Form_files/space.gif" width="1"></TD>
</TR>
<TR>
<TD valign="top" colspan="4"><TABLE id="Profile1_Personality" border="0" width="500">
	<TBODY><TR>
		<TD><INPUT id="Profile1_Personality_0" type="checkbox" name="Profile1:Personality:0" tabindex="25"><LABEL for="Profile1_Personality_0">adventurous</LABEL></TD><TD><INPUT id="Profile1_Personality_1" type="checkbox" name="Profile1:Personality:1" tabindex="25"><LABEL for="Profile1_Personality_1">logical</LABEL></TD><TD><INPUT id="Profile1_Personality_2" type="checkbox" name="Profile1:Personality:2" tabindex="25"><LABEL for="Profile1_Personality_2">emotional</LABEL></TD>

	</TR><TR>
		<TD><INPUT id="Profile1_Personality_3" type="checkbox" name="Profile1:Personality:3" tabindex="25"><LABEL for="Profile1_Personality_3">romantic</LABEL></TD><TD><INPUT id="Profile1_Personality_4" type="checkbox" name="Profile1:Personality:4" tabindex="25"><LABEL for="Profile1_Personality_4">passionate</LABEL></TD><TD><INPUT id="Profile1_Personality_5" type="checkbox" name="Profile1:Personality:5" tabindex="25"><LABEL for="Profile1_Personality_5">flirtatious</LABEL></TD>

	</TR><TR>
		<TD><INPUT id="Profile1_Personality_6" type="checkbox" name="Profile1:Personality:6" tabindex="25"><LABEL for="Profile1_Personality_6">friendly</LABEL></TD><TD><INPUT id="Profile1_Personality_7" type="checkbox" name="Profile1:Personality:7" tabindex="25"><LABEL for="Profile1_Personality_7">sociable</LABEL></TD><TD><INPUT id="Profile1_Personality_8" type="checkbox" name="Profile1:Personality:8" tabindex="25"><LABEL for="Profile1_Personality_8">outgoing</LABEL></TD>
	</TR><TR>

		<TD><INPUT id="Profile1_Personality_9" type="checkbox" name="Profile1:Personality:9" tabindex="25"><LABEL for="Profile1_Personality_9">helpful</LABEL></TD><TD><INPUT id="Profile1_Personality_10" type="checkbox" name="Profile1:Personality:10" tabindex="25"><LABEL for="Profile1_Personality_10">tolerant</LABEL></TD><TD><INPUT id="Profile1_Personality_11" type="checkbox" name="Profile1:Personality:11" tabindex="25"><LABEL for="Profile1_Personality_11">patient</LABEL></TD>
	</TR><TR>
		<TD><INPUT id="Profile1_Personality_12" type="checkbox" name="Profile1:Personality:12" tabindex="25"><LABEL for="Profile1_Personality_12">professional</LABEL></TD><TD><INPUT id="Profile1_Personality_13" type="checkbox" name="Profile1:Personality:13" tabindex="25"><LABEL for="Profile1_Personality_13">laid-back</LABEL></TD><TD><INPUT id="Profile1_Personality_14" type="checkbox" name="Profile1:Personality:14" tabindex="25"><LABEL for="Profile1_Personality_14">fun</LABEL></TD>

	</TR><TR>
		<TD><INPUT id="Profile1_Personality_15" type="checkbox" name="Profile1:Personality:15" tabindex="25"><LABEL for="Profile1_Personality_15">wild</LABEL></TD><TD><INPUT id="Profile1_Personality_16" type="checkbox" name="Profile1:Personality:16" tabindex="25"><LABEL for="Profile1_Personality_16">uninhibited</LABEL></TD><TD><INPUT id="Profile1_Personality_17" type="checkbox" name="Profile1:Personality:17" tabindex="25"><LABEL for="Profile1_Personality_17">experimental</LABEL></TD>

	</TR>
</TBODY></TABLE></TD>
</TR>
<TR>
<TD colspan="4"><BR>&nbsp;</TD>
</TR>
<TR>
<TD colspan="4"><STRONG>Interests and Activities</STRONG> (check all interests that you enjoy)</TD>

</TR>
<TR>
<TD bgcolor="#333333" colspan="4"><IMG height="1" src="./Model Registration Form_files/space.gif" width="1"></TD>
</TR>

<TR>
<TD valign="top" colspan="4"><TABLE id="Profile1_Activities" border="0" width="500">
	<TBODY><TR>
		<TD><INPUT id="Profile1_Activities_0" type="checkbox" name="Profile1:Activities:0" tabindex="26"><LABEL for="Profile1_Activities_0">meeting new people</LABEL></TD><TD><INPUT id="Profile1_Activities_1" type="checkbox" name="Profile1:Activities:1" tabindex="26"><LABEL for="Profile1_Activities_1">going out with friends</LABEL></TD><TD><INPUT id="Profile1_Activities_2" type="checkbox" name="Profile1:Activities:2" tabindex="26"><LABEL for="Profile1_Activities_2">going out on dates</LABEL></TD>
	</TR><TR>
		<TD><INPUT id="Profile1_Activities_3" type="checkbox" name="Profile1:Activities:3" tabindex="26"><LABEL for="Profile1_Activities_3">attending events</LABEL></TD><TD><INPUT id="Profile1_Activities_4" type="checkbox" name="Profile1:Activities:4" tabindex="26"><LABEL for="Profile1_Activities_4">nightlife</LABEL></TD><TD><INPUT id="Profile1_Activities_5" type="checkbox" name="Profile1:Activities:5" tabindex="26"><LABEL for="Profile1_Activities_5">dancing</LABEL></TD>

	</TR><TR>
		<TD><INPUT id="Profile1_Activities_6" type="checkbox" name="Profile1:Activities:6" tabindex="26"><LABEL for="Profile1_Activities_6">parties</LABEL></TD><TD><INPUT id="Profile1_Activities_7" type="checkbox" name="Profile1:Activities:7" tabindex="26"><LABEL for="Profile1_Activities_7">theatre</LABEL></TD><TD><INPUT id="Profile1_Activities_8" type="checkbox" name="Profile1:Activities:8" tabindex="26"><LABEL for="Profile1_Activities_8">music</LABEL></TD>
	</TR><TR>
		<TD><INPUT id="Profile1_Activities_9" type="checkbox" name="Profile1:Activities:9" tabindex="26"><LABEL for="Profile1_Activities_9">concerts</LABEL></TD><TD><INPUT id="Profile1_Activities_10" type="checkbox" name="Profile1:Activities:10" tabindex="26"><LABEL for="Profile1_Activities_10">outdoors</LABEL></TD><TD><INPUT id="Profile1_Activities_11" type="checkbox" name="Profile1:Activities:11" tabindex="26"><LABEL for="Profile1_Activities_11">nature</LABEL></TD>
	</TR><TR>
		<TD><INPUT id="Profile1_Activities_12" type="checkbox" name="Profile1:Activities:12" tabindex="26"><LABEL for="Profile1_Activities_12">sports</LABEL></TD><TD><INPUT id="Profile1_Activities_13" type="checkbox" name="Profile1:Activities:13" tabindex="26"><LABEL for="Profile1_Activities_13">hiking</LABEL></TD><TD><INPUT id="Profile1_Activities_14" type="checkbox" name="Profile1:Activities:14" tabindex="26"><LABEL for="Profile1_Activities_14">camping</LABEL></TD>

	</TR><TR>
		<TD><INPUT id="Profile1_Activities_15" type="checkbox" name="Profile1:Activities:15" tabindex="26"><LABEL for="Profile1_Activities_15">extreme sports</LABEL></TD><TD><INPUT id="Profile1_Activities_16" type="checkbox" name="Profile1:Activities:16" tabindex="26"><LABEL for="Profile1_Activities_16">travel</LABEL></TD><TD><INPUT id="Profile1_Activities_17" type="checkbox" name="Profile1:Activities:17" tabindex="26"><LABEL for="Profile1_Activities_17">exotic travel</LABEL></TD>
	</TR>
</TBODY></TABLE></TD>
</TR>
<TR>
<TD colspan="4"><BR>
&nbsp;</TD>
</TR>
<TR>

<TD colspan="4"><STRONG>What You Offer</STRONG></TD>
</TR>
<TR>
<TD bgcolor="#333333" colspan="4"><IMG height="1" src="./Model Registration Form_files/space.gif" width="1"></TD>
</TR>
<TR>
<TD valign="top" colspan="4">Please write a description 
about yourself and what you can offer your clients. Use this are to tell 
us what you are good at and what you would like to do. You have to 
convince us why you are better than other applicants and what more you can 
offer.<BR>

<TEXTAREA name="Profile1:Offer" id="Profile1_Offer" tabindex="28" class="textfield"></TEXTAREA></TD>
</TR>
<TR>
<TD colspan="4"><BR>
&nbsp; </TD>

</TR>
<TR>
<TD colspan="4"><STRONG>Photographs</STRONG> (we need at least one clear photo of you. You can upload up to 5. We do not accept any sexually explicit photos)</TD>
</TR>
<TR>
<TD bgcolor="#333333" colspan="4"><IMG height="1" src="./Model Registration Form_files/space.gif" width="1"></TD>
</TR>

<TR>
<TD valign="top">Photo 1:</TD>
<TD colspan="3"><INPUT name="Profile1:UploadFile1" id="Profile1_UploadFile1" type="file" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; BORDER-LEFT: #808080 1px solid; WIDTH: 340px; BORDER-BOTTOM: #808080 1px solid; HEIGHT: 22px" size="35" tabindex="30"> <SPAN id="Profile1_lblPhoto1"></SPAN></TD>
</TR>

<TR>
<TD valign="top">Photo 2:</TD>
<TD colspan="3"><INPUT name="Profile1:UploadFile2" id="Profile1_UploadFile2" type="file" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; BORDER-LEFT: #808080 1px solid; WIDTH: 340px; BORDER-BOTTOM: #808080 1px solid; HEIGHT: 22px" size="35" tabindex="31"> <SPAN id="Profile1_lblPhoto2"></SPAN></TD>
</TR>
<TR>
<TD valign="top">Photo 3:</TD>
<TD colspan="3"><INPUT name="Profile1:UploadFile3" id="Profile1_UploadFile3" type="file" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; BORDER-LEFT: #808080 1px solid; WIDTH: 340px; BORDER-BOTTOM: #808080 1px solid; HEIGHT: 22px" size="35" tabindex="32"> <SPAN id="Profile1_lblPhoto3"></SPAN></TD>

</TR>
<TR>
<TD valign="top">Photo 4:</TD>
<TD colspan="3"><INPUT name="Profile1:UploadFile4" id="Profile1_UploadFile4" type="file" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; BORDER-LEFT: #808080 1px solid; WIDTH: 340px; BORDER-BOTTOM: #808080 1px solid; HEIGHT: 22px" size="35" tabindex="33"> <SPAN id="Profile1_lblPhoto4"></SPAN> 

</TD>
</TR>
<TR>
<TD valign="top">Photo 5:</TD>
<TD colspan="3"><INPUT name="Profile1:UploadFile5" id="Profile1_UploadFile5" type="file" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; BORDER-LEFT: #808080 1px solid; WIDTH: 340px; BORDER-BOTTOM: #808080 1px solid; HEIGHT: 22px" size="35" tabindex="34"> <SPAN id="Profile1_lblPhoto5"></SPAN> 
</TD>
</TR>
<TR>
<TD colspan="4"><BR>

Copyright notice for photographs (if applicable):<BR>
<INPUT name="Profile1:Copyright" type="text" id="Profile1_Copyright" tabindex="35" class="textfield"></TD>
</TR>
<TR>

<TD colspan="4"><P>&nbsp;</P>
<P>I certify that all information provided are crediblet and that 
I agree with the terms and shall abide by the rules.<BR>
<SPAN id="Profile1_Agree"><INPUT id="Profile1_Agree_0" type="radio" name="Profile1:Agree" value="N" checked="checked" tabindex="36"><LABEL for="Profile1_Agree_0">No, I do not agree</LABEL><BR><INPUT id="Profile1_Agree_1" type="radio" name="Profile1:Agree" value="Y" tabindex="36"><LABEL for="Profile1_Agree_1">Yes, I agree</LABEL><BR></SPAN>
<BR>
&nbsp;

<BR>&nbsp;</P></TD>

</TR>
</TBODY></TABLE>
<DIV align="center">
<INPUT type="submit" name="Profile1:Submit" value="Submit Application" onclick="if (typeof(Page_ClientValidate) == 'function') Page_ClientValidate(); " language="javascript" id="Profile1_Submit" tabindex="35">
<BR>
</DIV>

<DIV align="center">

</DIV>
    </FORM>

well there is a couple of ways to do this. First, you could add the email address in the "action" of the form
Ex..

<form action="mailto:someone@yahoo.com" enctype="text/plain">

or PHP method..

<?php
$to = "somebody@example.com"; 
$subject = "My subject";
$txt = "Hello world!";
$headers = "From: webmaster@example.com" . "\r\n" .
"CC: somebodyelse@example.com";

mail($to,$subject,$txt,$headers);
?> 
If you get a problem using the php method, then you need to configure your SMTP in your PHP.ini. Hope this helps
Member Avatar for diafol

OK, so where's your effort? Show some effort. Have you looked at the php manual? You could get the code mentioned above from about a 1000 php sites. Google too difficult?

Hi,
Ill show some effort...

Now First you need to create a new php document that will contain all the email codes.

<?php
/* reg.php */
// get posted data into local variables
$Name = Trim(stripslashes($_POST['name']));  
$Email = Trim(stripslashes($_POST['email'])); 
$Message = Trim(stripslashes($_POST['message'])); 
$To = Trim(stripslashes($_POST['to']));
$EmailTo = 'To: '.$Name.' <'.$Email.'>' . "\r\n";
$Subject = "Website Message";

if (!empty($Name)) {
if (!empty($Email)) {
if (!empty($Message)) {


// To send HTML mail, the Content-type header must be set
$headersadmin  = 'MIME-Version: 1.0' . "\r\n";
$headersadmin .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

// Additional headers
$headersadmin .= 'From: '.$Name.' <'.$Email.'>' . "\r\n";

// To send HTML mail, the Content-type header must be set
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

// Additional headers
$headers .= 'From: Who ever <email address>' . "\r\n";

// messageadmin
$bodyadmin = '
<html>
<head>
</head>
<body>
<div style="vertical-align:middle;">
<img src="'.pgurl.'/images/logo.png" alt="'.pgtitle.'" height="160" boder="0" /><img src="'.pgurl.'/new_website/images/header.png" alt="'.pgtitle.'" width="400"  border ="0" />
</div>
  <br /><br />
Name: '.$Name.'<br />
Email: '.$Email.'<br />
<br />
Message:<br />
'.$Message.'
</body>
</html>
';

// message
$body = '
<html>
<head>
</head>
<body>
  <div style="vertical-align:middle;">
<img src="'.pgurl.'/images/logo.png" alt="'.pgtitle.'" height="160" boder="0" /><img src="'.pgurl.'/new_website/images/header.png" alt="'.pgtitle.'" width="400"  border ="0" />
</div><br /><br />
Dear, '.$Name.'<br />
Your message was sent successfully.<br /><br />
Your Message was:<br />
'.$Message.'<br />
<br />
Yours truly,<br />
SOmebody
</body>
</html>
';

// send email 
$success = mail($EmailTo, $Subject, $body, $headers);
$success .= mail($To, $Subject, $bodyadmin, $headersadmin);
} else {
	$success = false;	
}
}
}

// redirect to success page 
if ($success){
  print "<meta http-equiv=\"refresh\" content=\"0;URL=../index.php\">";
  echo "<script>alert('Your Message Has Been Sent.')</script>"; 
} else {
  print "<meta http-equiv=\"refresh\" content=\"0;URL=../index.php\">";
  echo "<script>alert('Your message was not sent, our administrators will check it out.')</script>"; 
}
?>

This code will email to you and a the person who email it.. Its not perfect but it works. But you will need to configure it to your needs!

Then in your html page with the code:

<FORM name="Form" method="post" action="reg.html"id="Form" enctype="multipart/form-data" onsubmit="return validateForm(this)">

you need to replace with:

<FORM name="Form" method="post" action="reg.php"id="Form" enctype="multipart/form-data" onsubmit="return validateForm(this)">

Notice i changed the reg.html with reg.php.

This might work, give it ago!

Thanks,
Marais

Member Avatar for diafol

Gawd! I wasn't talking to you marases. I was referring to the OP. When somebody posts a question on this forum, they are expected to show some effort with regard to trying a few things - at least post their code. That way a contributor can help them on their way and let THEM do the work. The worst thing you can do is post a solution where the OP has made no effort. This fills up the forum with fly-by posters with 'help me now' posts. This is killing the site.

The worst thing you can do is post a solution where the OP has made no effort. This fills up the forum with fly-by posters with 'help me now' posts. This is killing the site.

Where are moderators? Can't they nail rule that gimme gimme gimme is a taboo?
Apart from purple stress (If you don't believe me visit beautiful programmingforums), the only headache is lazy people who wants somebody to earn a degree for them!
Strange and stupid :angry:

i understand what u mean ardav, n mr evstevemd, u need not be rude about it...like i said b4,am new to dis site and to php, was expecting to learn 4rm u guys, but wen u make assaultive posts like dis, makes me feel like i wasted my time registering... thanks morases and fobos i appreciate your effort..here something i came up wit on my own b4 i made dis post, was not sure it would work thats y i asked for help,i wasn't sure it would work with all the entered data in d registration form.. heres what i did,wit much difficulty and little help by the way...

<?php
error_reporting(E_ALL ^ E_NOTICE);

$my_email = "user@example.com";


$errors = array();

// Remove $_COOKIE elements from $_REQUEST.

if(count($_COOKIE)){foreach(array_keys($_COOKIE) as $value){unset($_REQUEST[$value]);}}

if(isset($_REQUEST['email']) && !empty($_REQUEST['email']))
{

$_REQUEST['email'] = trim($_REQUEST['email']);

if(substr_count($_REQUEST['email'],"@") != 1 || stristr($_REQUEST['email']," ") || stristr($_REQUEST['email'],"\\") || stristr($_REQUEST['email'],":")){$errors[] = "Email address is invalid";}else{$exploded_email = explode("@",$_REQUEST['email']);if(empty($exploded_email[0]) || strlen($exploded_email[0]) > 64 || empty($exploded_email[1])){$errors[] = "Email address is invalid";}else{if(substr_count($exploded_email[1],".") == 0){$errors[] = "Email address is invalid";}else{$exploded_domain = explode(".",$exploded_email[1]);if(in_array("",$exploded_domain)){$errors[] = "Email address is invalid";}else{foreach($exploded_domain as $value){if(strlen($value) > 63 || !preg_match('/^[a-z0-9-]+$/i',$value)){$errors[] = "Email address is invalid"; break;}}}}}}

}

if(!(isset($_SERVER['HTTP_REFERER']) && !empty($_SERVER['HTTP_REFERER']) && stristr($_SERVER['HTTP_REFERER'],$_SERVER['HTTP_HOST']))){$errors[] = "You must enable referrer logging to use the form";}

function recursive_array_check_blank($element_value)
{

global $set;

if(!is_array($element_value)){if(!empty($element_value)){$set = 1;}}
else
{

foreach($element_value as $value){if($set){break;} recursive_array_check_blank($value);}

}

}

recursive_array_check_blank($_REQUEST);

if(!$set){$errors[] = "You cannot send a blank form";}

unset($set);


if(count($errors)){foreach($errors as $value){print "$value<br>";} exit;}

if(!defined("PHP_EOL")){define("PHP_EOL", strtoupper(substr(PHP_OS,0,3) == "WIN") ? "\r\n" : "\n");}


function build_message($request_input){if(!isset($message_output)){$message_output ="";}if(!is_array($request_input)){$message_output = $request_input;}else{foreach($request_input as $key => $value){if(!empty($value)){if(!is_numeric($key)){$message_output .= str_replace("_"," ",ucfirst($key)).": ".build_message($value).PHP_EOL.PHP_EOL;}else{$message_output .= build_message($value).", ";}}}}return rtrim($message_output,", ");}

$message = build_message($_REQUEST);

$message = $message . PHP_EOL.PHP_EOL."-- ".PHP_EOL."Thank you";

$message = stripslashes($message);

$subject = "Comments";

$subject = stripslashes($subject);

if($from_email)
{

$headers = "From: " . $from_email;
$headers .= PHP_EOL;
$headers .= "Reply-To: " . $_REQUEST['email'];

}
else
{

$from_name = "";

if(isset($_REQUEST['name']) && !empty($_REQUEST['name'])){$from_name = stripslashes($_REQUEST['name']);}

$headers = "From: {$from_name} <{$_REQUEST['email']}>";

}

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

?>

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

<html>

<head>
<title>Contact Us</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#000" text="#fff">

<div>
<center>
<b>Thank you <?php if(isset($_REQUEST['name'])){print stripslashes($_REQUEST['name']);} ?></b>
<br>Your message has been sent
<p><a href="http://www.kholyns.com">Click here to continue</a></p>
</center>
</div>

</body>
</html>

1. I get sick and tired of those lazy guys, so if you aren't the like don't post on their thread "soup for free, gimme one please". The whole thread heading fueled anger as to why someone will not work. So, you are welcome!

2. Use straight english. Not many here (me included) full understand the kind of english you use.

3. Say exactly what is not working, how did you suppose it work and how it currently behaving.

4. For complete noob, read PHP Guide for complete new bees

commented: Couldn't have said that better myself! +3

mr stevemd, its queens English, with some shorts and funk thats all...and pls take it easy, your diction denotes anger..are you a moderator???i hope not else this site'll be a concentration and you'll be KGB...kidding, but take it easy bro...and thanks for the link, am checking it out now, i hope its helpful...i'll appreciate tutorials too if you dont mind. Thanks again

mr stevemd, its queens English, with some shorts and funk thats all...and pls take it easy, your diction denotes anger..are you a moderator???i hope not else this site'll be a concentration and you'll be KGB...kidding, but take it easy bro...and thanks for the link, am checking it out now, i hope its helpful...i'll appreciate tutorials too if you dont mind. Thanks again

"I need a car urgent please..." :)
I don't get paid here and no body is, at least AFAIK. So when people demands, it make somebody angry you know. But don't worry, I don't puch people and believe me I don't qualify for KGB ;)

And no, I'm not moderator, and If I could be one the first rule will be "Show your effort or find another forum" :)

Anyway, it is funny to help people who deserve help and I cannot help but "exhort" lazy people :icon_razz:

okay Mr.stevemd, noted. I understand what you're doing, and am totally in support of it, have you viewed my effort??

Member Avatar for diafol

Dear markolini. For your information, here is an extract from the Member Rules:

Keep it Clear
*Do post in full-sentence English
*Do use clear and relevant titles for new threads
*Do not write in all uppercase or use "leet", "txt" or "chatroom" speak

Keep It Organized
*Do provide evidence of having done some work yourself if posting questions from schoolwork assignments

Where 'school assignments' are mentioned, I and a number of other regular contributors consider this as a general proviso as opposed to pertaining to school assignments only.

If I came across as rude, I apologise. It is merely my frustration - noobs simply do not read the member rules.

As for your code, is this yours ('I did this with a lot of difficult and next to no help')? If not, seek help from the author. If so, here's a few pointers:

if (!empty($Name)) {
if (!empty($Email)) {
if (!empty($Message)) {
...
}
}
}

This works, but you could reduce 6 lines to 2 by:

if(!empty($Name) && !empty($Email) && !empty($Message)){
...
}

$_REQUEST[] variables aren't very safe. Although they are used extensively in tutorials (usually by javascript experts!), avoid them. Use specific sglobal variables like $_GET or $_POST.

I'm not sure where you're getting a problem. Which part of your code is causing problems? Don't reply 'Please check my code'.

Mr. ardav, i did not say there was a problem with the script, what i needed was someone to help me verify that all the information entered in the registration form, like the photo uploads, the check boxes and every other thing, will be e-mailed to the address provide, because from on the scripts i found(since what i did was develop one that was already made) only shows variables for e-mail, message and name, i wasn't it would work for the other entry datas. I hope you understand my problem now sir.

Member Avatar for diafol

If there is no problem with the script, I don't understand what you expect us to do? Guess if there is a problem? You have to test it yourself. If you get errors, tinker with the code and test again. After you've spent a good day or so exhausting avenues and are still getting errors, then come back. This is not a verification forum.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.