kanexpo Posted October 12, 2007 Share Posted October 12, 2007 Hi can someone please tell me why this isnt working 'Online Form: '.$subject, .$_SERVER['REMOTE_ADDR'], "Name: $name"), ."\n\n".$message, "From: $from"); It's from an Online Contact form. I had to add the "name" manually and i seem to have done something wrong. thanks Quote Link to comment https://forums.phpfreaks.com/topic/73016-php-quick-question/ Share on other sites More sharing options...
rlindauer Posted October 12, 2007 Share Posted October 12, 2007 Syntax and other errors <?php 'Online Form: '.$subject, .$_SERVER['REMOTE_ADDR'], "Name: $name"), ."\n\n".$message, "From: $from"); ?> <?php print "Online Form: $subject, " . $_SERVER['REMOTE_ADDR'] . ", Name: $name,\n\n$message, From: $from"; ?> You also need to either print/echo the string, or store it in a variable. edit: wait a minute... can you post more of this code? Quote Link to comment https://forums.phpfreaks.com/topic/73016-php-quick-question/#findComment-368169 Share on other sites More sharing options...
kanexpo Posted October 12, 2007 Author Share Posted October 12, 2007 hi, thanks for the reply. here is the full code <?php // load the variables form address bar $subject = $_REQUEST["subject"]; $message = $_REQUEST["message"]; $name = $_REQUEST["name"]; $from = $_REQUEST["from"]; $verif_box = $_REQUEST["verif_box"]; // remove the backslashes that normally appears when entering " or ' $message = stripslashes($message); $subject = stripslashes($subject); $name = stripslashes($name); $from = stripslashes($from); // check to see if verificaton code was correct if(md5($verif_box).'a4xn' == $_COOKIE['tntcon']){ // if verification code was correct send the message and show this page mail("your@email.com", 'Online Form: '.$subject, .$_SERVER['REMOTE_ADDR'], "Name: $name"), ."\n\n".$message, "From: $from"); // delete the cookie so it cannot sent again by refreshing this page setcookie('tntcon',''); } else { // if verification code was incorrect then return to contact page and show error header("Location:".$_SERVER['HTTP_REFERER']."?subject=$subject&from=$from&message=$message&wrong_code=true"); exit; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>E-Mail Sent</title> <style type="text/css"> <!-- body,td,th { font-family: Arial, Helvetica, sans-serif; font-size: 12px; } --> </style></head> <?php include 'thanks.php'; ?> <body> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/73016-php-quick-question/#findComment-368220 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.