Jump to content

contact form problem


forsakenmemory

Recommended Posts

this is a bit od not sure why its doing this the code below works pefectly. until i add another $var to the

 

mail($youremail, $subject, $name, $msg, "From: $email\r\nReply-to: $email\r\n");

 

i can change the varibles to what ever i want but if i use more then 4 the form stops working does anyone know why?

 

ive tried loads of stuff but cant figure out why the limit is 4

 

<?php

$youremail = "admin@xxx.com";

$thankyou = "ok.htm";

if($email == ""){
?>
No email address added. Please go back.<br/>
<?php
;}elseif($name == ""){
?>
No name added. Please go back.<br/>
<?php
;}elseif($message == ""){
?>
No message added. Please go back.<br/>
<?php
;}else{

$msg = ereg_replace("\\\'", "'", $message);
$msg = ereg_replace('\\\"', "\"", $msg);
$message1 = "from: $name\nemail: $email\nmessage:\n$msg1";

mail($youremail, $subject, $name, $msg, "From: $email\r\nReply-to: $email\r\n");
?>
<meta http-equiv="refresh" content="0; url=<?echo $thankyou;?>"">
<?php
}
?>

Link to comment
Share on other sites

First, I'd suggest reading the manual on the mail() function - http://ca.php.net/manual/en/ref.mail.php

 

Your code needs a major overhaul. $email and $message are never defined (I assume you're coding as if register_globals is ON - poor choice, and unlikely in any recent php installation. Did this originally appear in some ancient book?).  $message1 appears to serve no purpose. The construct :} is one I'm not familiar with, and I can't figure out how this code ever runs without issuing syntax error messages.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.