PHP Contact Form

I try using this

[FONT=Courier New]<form method="[COLOR=#0000ff]POST[/COLOR]" action="[COLOR=#0000ff]mailer.php[/COLOR]">
<input type=“text” name="[COLOR=#0000ff]name[/COLOR]" size=“19”><br>
<br>
<input type=“text” name="[COLOR=#0000ff]email[/COLOR]" size=“19”><br>
<br>
<textarea rows=“9” name="[COLOR=#0000ff]message[/COLOR]" cols=“30”></textarea>
<br>
<br>
<input type=“submit” value=“Submit” name="[COLOR=#0000ff]submit[/COLOR]">
</form>[/FONT]

[FONT=Courier New]for my contact.htm[/FONT]
[FONT=Courier New]and[/FONT]

[COLOR=#0000ff]<?[/COLOR][COLOR=#000050]php[/COLOR] [COLOR=#006610]if[/COLOR]COLOR=#0000ff[/COLOR] [COLOR=#0000ff]{[/COLOR] [COLOR=#000050]$to[/COLOR] [COLOR=#0000ff]=[/COLOR] [COLOR=#666666]“you@you.com”[/COLOR]; [COLOR=#000050]$subject[/COLOR] [COLOR=#0000ff]=[/COLOR] [COLOR=#666666]“Form Tutorial”[/COLOR]; [COLOR=#000050]$name_field[/COLOR] [COLOR=#0000ff]=[/COLOR] [COLOR=#000050]$_POST[/COLOR][COLOR=#0000ff][[/COLOR][COLOR=#666666]‘name’[/COLOR][COLOR=#0000ff]][/COLOR]; [COLOR=#000050]$email_field[/COLOR] [COLOR=#0000ff]=[/COLOR] [COLOR=#000050]$_POST[/COLOR][COLOR=#0000ff][[/COLOR][COLOR=#666666]‘email’[/COLOR][COLOR=#0000ff]][/COLOR]; [COLOR=#000050]$message[/COLOR] [COLOR=#0000ff]=[/COLOR] [COLOR=#000050]$_POST[/COLOR][COLOR=#0000ff][[/COLOR][COLOR=#666666]‘message’[/COLOR][COLOR=#0000ff]][/COLOR]; [COLOR=#000050]$body[/COLOR] [COLOR=#0000ff]=[/COLOR] [COLOR=#666666]“From: $name_field
E-Mail: $email_field
Message:
$message”[/COLOR]; [COLOR=#000050]echo[/COLOR] [COLOR=#666666]“Data has been submitted to $to!”[/COLOR]; [COLOR=#000050]mail[/COLOR][COLOR=#0000ff]([/COLOR][COLOR=#000050]$to[/COLOR], [COLOR=#000050]$subject[/COLOR], [COLOR=#000050]$body[/COLOR][COLOR=#0000ff])[/COLOR]; [COLOR=#0000ff]}[/COLOR] [COLOR=#006610]else[/COLOR] [COLOR=#0000ff]{[/COLOR] [COLOR=#000050]echo[/COLOR] [COLOR=#666666]“blarg!”[/COLOR]; [COLOR=#0000ff]}[/COLOR] [COLOR=#0000ff]?>[/COLOR] [FONT=Courier New]for my mailer.php[/FONT]

[FONT=Courier New]It works, now the question is [COLOR=#000050]echo[/COLOR] [COLOR=#666666]“Data has been submitted to $to!”[/COLOR]; <------ can i change it to my own .html page? or i mean redirect from other pages?[/FONT]

[FONT=Courier New]Thanks![/FONT]

mailer.php

 
<?php 
if(isset($_POST['submit'])) { 
$to = you@you.com; 
$subject = "Form Tutorial"; 
$name_field = $_POST['name']; 
$email_field = $_POST['email']; 
$message = $_POST['message']; 
$body = "From: $name_field
 E-Mail:$email_field

Message:
$message"; 
?>
Data has been submitted to <a href="<?=$to;?>"><?=$to;?></a>
<?
mail($to, $subject, $body); 
} else { 
echo "blarg!"; 
} 
?>

try that man, i’m sure it will work… cheers!!


yes bro this is same ad mine. well i need to rederect this part
Data has been submitted to <a href=“<?=$to;?>”><?=$to;?></a>
<? i dont want afer sending the form it will say Data has been submitted to you@you.com all i need is when i send the form it will go to another html or php. or some kind like this www.jassonthursday.com

thanks bro! God bless

try to use javascript…

 
<script language="javascript">
setTimeout("location.href='yourlink'", delay);
</script>

example…

 
<?php 
if(isset($_POST['submit'])) { 
$to = you@you.com; 
$subject = "Form Tutorial"; 
$name_field = $_POST['name']; 
$email_field = $_POST['email']; 
$message = $_POST['message']; 
$body = "From: $name_field
 E-Mail:$email_field

Message:
$message"; 
?>
<script language="javascript">
setTimeout(
"location.href='http://www.jassonthursday.com'", 
500);
</script>
<?
mail($to, $subject, $body); 
} else { 
echo "blarg!"; 
} 
?>

cheers!!!