Newbie email error

Reply

Join Date: Aug 2008
Posts: 4
Reputation: vincan is an unknown quantity at this point 
Solved Threads: 0
vincan vincan is offline Offline
Newbie Poster

Newbie email error

 
0
  #1
Aug 26th, 2008
Good day

I want to write multiple response to my email, I get line 7

Please can anyone help please;

My code

<?php
$to = "info@apps4u.co.za"; 
$subject = "Contact Us"; 
$email = $_REQUEST['email'] ;

$q1 = "Feed back text:\n";
$q1 .= "$_REQUEST['text']\n" ;
$q2 = "Who sent you:";
$q2 .= "$_REQUEST['whosentyou']\n" ;

$name = $_REQUEST['name'] ;
$headers = "From: $name <$email>";
$whosentyou = $_REQUEST['whosentyou'] ;
$message = $q1 . "\n". $q2; 
$sent = mail($to, $subject, $message, $headers) ; 
if($sent) 
{print "Your mail was sent successfully"; }
else 
{print "We encountered an error sending your mail"; }
?>
The error
  1. Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in C:\Domains\apps4u.co.za\wwwroot\ServecisRequest.php on line 7


Thanks
Last edited by peter_budo; Aug 26th, 2008 at 4:32 pm. Reason: Keep It Organized - please use [code] tags
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 381
Reputation: langsor is an unknown quantity at this point 
Solved Threads: 33
langsor langsor is offline Offline
Posting Whiz

Re: Newbie email error

 
0
  #2
Aug 26th, 2008
PHP does not like array values inside of strings ...
You can do several things here. Replace $q1 .= "$_REQUEST['text']\n" ; with ...
  1. $q1 .= "{$_REQUEST['text']}\n"
  2. // ... or ...
  3. $q1 .= $_REQUEST['text']."\n";

Hope this helps
Google is the answer to all of your questions -- the trick is knowing what question to ask in your specific predicament.
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 4
Reputation: vincan is an unknown quantity at this point 
Solved Threads: 0
vincan vincan is offline Offline
Newbie Poster

Re: Newbie email error

 
0
  #3
Aug 27th, 2008
Thanks I will try this and get back to you.
Thank you
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 213
Reputation: nikesh.yadav is an unknown quantity at this point 
Solved Threads: 17
nikesh.yadav's Avatar
nikesh.yadav nikesh.yadav is offline Offline
Posting Whiz in Training

Re: Newbie email error

 
0
  #4
Aug 27th, 2008
try this it will work

  1. <?php
  2. $to = "info@apps4u.co.za";
  3. $subject = "Contact Us";
  4. $email = $_REQUEST['email'] ;
  5.  
  6. $q1 = "Feed back text:\n";
  7. $q1 .= $_REQUEST['text'] ."<br />" ;
  8. $q2 = "Who sent you:";
  9. $q2 .= $_REQUEST['whosentyou']."<br />" ;
  10. $name = $_REQUEST['name'] ;
  11. $headers = "From:". $name ."<".$email.">";
  12. $whosentyou = $_REQUEST['whosentyou'] ;
  13. $message = $q1 . "\n". $q2;
  14. $sent = mail($to, $subject, $message, $headers) ;
  15. if($sent)
  16. {print "Your mail was sent successfully"; }
  17. else
  18. {print "We encountered an error sending your mail"; }
  19. ?>
Help as an alias

I think programming is great................
Tour Travel weblink by me and about Tour ,
Go To My Home Page and I m in Webdevelopment.
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 213
Reputation: nikesh.yadav is an unknown quantity at this point 
Solved Threads: 17
nikesh.yadav's Avatar
nikesh.yadav nikesh.yadav is offline Offline
Posting Whiz in Training

Re: Newbie email error

 
0
  #5
Aug 27th, 2008
dear vican


use some good editor like dreamweaver or vs.php
Help as an alias

I think programming is great................
Tour Travel weblink by me and about Tour ,
Go To My Home Page and I m in Webdevelopment.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC