LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Parse error: syntax error, unexpected '@' in php code (https://www.linuxquestions.org/questions/programming-9/parse-error-syntax-error-unexpected-%40-in-php-code-886216/)

minipro 06-14-2011 04:26 AM

Parse error: syntax error, unexpected '@' in php code
 
Parse error: syntax error, unexpected '@' in C:\xampp\htdocs\minippro\mail.php on line 8 .......its not recognizing the '@' symbol. im a beginner in php so plz do help out. heres the code im working with

<?php $receiver = myfriend@ourmail.co.in; $subject = wish; $content = Hi! My dear friend how are you.; $sender = myself@ ourmail.co.in ; $headers = From: $sender; mail($receiver,$subject, $content,$headers); echo Mail has been sent successfully.; ?>

smoker 06-14-2011 04:33 AM

Try using double quotes around your variable values.
Code:

$receiver = "myfriend@ourmail.co.in";
$subject = "wish";
$content = "Hi! My dear friend how are you.";
etc.

And please use the code tags when posting code.


All times are GMT -5. The time now is 05:40 AM.