| | |
Newbie email error
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Aug 2008
Posts: 4
Reputation:
Solved Threads: 0
Good day
I want to write multiple response to my email, I get line 7
Please can anyone help please;
My code
The error
Thanks
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"; }
?> PHP Syntax (Toggle Plain Text)
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
•
•
Join Date: Aug 2008
Posts: 381
Reputation:
Solved Threads: 33
PHP does not like array values inside of strings ...
You can do several things here. Replace $q1 .= "$_REQUEST['text']\n" ; with ...
Hope this helps
You can do several things here. Replace $q1 .= "$_REQUEST['text']\n" ; with ...
php Syntax (Toggle Plain Text)
$q1 .= "{$_REQUEST['text']}\n" // ... or ... $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.
try this it will work
PHP Syntax (Toggle Plain Text)
<?php $to = "info@apps4u.co.za"; $subject = "Contact Us"; $email = $_REQUEST['email'] ; $q1 = "Feed back text:\n"; $q1 .= $_REQUEST['text'] ."<br />" ; $q2 = "Who sent you:"; $q2 .= $_REQUEST['whosentyou']."<br />" ; $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"; } ?>
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.
I think programming is great................
Tour Travel weblink by me and about Tour ,
Go To My Home Page and I m in Webdevelopment.
dear vican
use some good editor like dreamweaver or vs.php
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.
I think programming is great................
Tour Travel weblink by me and about Tour ,
Go To My Home Page and I m in Webdevelopment.
![]() |
Similar Threads
- Error: "Use of undefined constant" Help! (PHP)
- newbie needs help with red circle white x trojan (Viruses, Spyware and other Nasties)
- parse error (PHP)
- Linux Newbie (Getting Started and Choosing a Distro)
- "Forbidden / You don't have permission to access / on this server." error (Linux Servers and Apache)
- Newbie seeks urgent help (PHP)
- Voice Recogntion VB06 newbie asking (Visual Basic 4 / 5 / 6)
- Newbie Question. how to put url into echo $row (PHP)
- Validating Email Addresses - A little extra help! (PHP)
Other Threads in the PHP Forum
- Previous Thread: XSS and textarea
- Next Thread: Please I need help on image upload to mysql and display in browser
| Thread Tools | Search this Thread |
.htaccess ajax apache api array beginner binary broken buttons cakephp checkbox class cms code cron curl database date directory display dynamic ebooks echo email error file files folder form forms function functions google href htaccess html image include insert integration ip java javascript joomla limit link login loop mail mediawiki menu mlm mod_rewrite multiple mysql number oop paypal pdf php phpincludeissue phpmyadmin problem query radio random recursion regex remote script search server sessions sms soap source sp space speed sql subdomain syntax system table tag tutorial update upload url validation validator variable vbulletin video web webdesign websphere white xml youtube





