Jump to content

Archived

This topic is now archived and is closed to further replies.

Jill78

Parse error: syntax error, unexpected ':'

Recommended Posts

Odd. Try replacing that whole lot with
[code]
extract($_POST);
[/code]

(that will do the exact same thing as all those lines). Then see if you still get an error.

Share this post


Link to post
Share on other sites
There is absolutely no syntax error resulting from those lines as posted. I copied them to my own server and they give no error at all.  Are you sure you have uploaded the current/edited version to your server?

Share this post


Link to post
Share on other sites
Andy- yes!  So it works for you? That is so odd. Could it be my browser? I don't get it....

King Arthur- I don't get you you mean... replace the whole thing?

Share this post


Link to post
Share on other sites
I tried replacing with the single line, now it is line 41

mail("jillpearson@comcast.net", $subject, $msg, "Jill");

Share this post


Link to post
Share on other sites
There must still be something in your script that is throwing the PHP interpreter. Post the whole thing again.

Share this post


Link to post
Share on other sites
when telling us your code, you need to post more than just the line with the orror, post about 5 lines below and 5 lines above the error too

Share this post


Link to post
Share on other sites
Here is the code that Andy tried out (I think) and it worked for him, but I got an error on the line reading:  $posterstyle = $_POST['posterstyle'];

When I replaced the upper part with  extract($_POST), then I would get the error on this line:

mail("jillpearson@comcast.net", $subject, $msg, "Jill");



<?php

$visitor = $_POST['visitor'];
$visitoremail = $_POST['visitoremail'];
$visitorstreet = $_POST['visitorstreet'];
$visitorcity = $_POST['visitorcity'];
$visitorstate = $_POST['visitorstate'];
$visitorzipcode = $_POST['visitorzipcode'];
$paymentmethod = $_POST['paymentmethod'];
$posterstyle = $_POST['posterstyle'];
$posterline = $_POST['posterline'];
$playername = $_POST['playername'];
$colors = $_POST['colors'];
$maintext = $_POST['maintext'];
$smalltext = $_POST['smalltext'];
$playernumber = $_POST['playernumber'];     
$mainphoto = $_POST['mainphoto'];


if(!$visitormail == "" && (!strstr($visitormail,"@") || !strstr($visitormail,".")))
{
echo "<h2>Use Back - Enter valid e-mail</h2>\n";
$badinput = "<h2>Feedback was NOT submitted</h2>\n";
}
if(empty($visitor) || empty($visitormail) || empty($notes )) {
echo "<h2>Use Back - fill in all fields</h2>\n";
}
echo $badinput;

$todayis = date("l, F j, Y, g:i a") ;

$subject = $visitor;


$msg="
Name: $visitor \n
Email: $visitoremail \n
Street: $visitorstreet\n
City: $visitorcity \n
State: $visitorstreet \n
Zip Code: $visitorzipcode
Payment Method: $paymentmethod \n
Poster Style: $posterstyle \n
Poster Line: $posterline \n
Player Name: $playername \n
Colors: $colors \n
Main Text: $maintext \n
Small Text: $smalltext \n
Player Number: $playernumber \n
Main Photo: $mainphoto \n
Additional Info: IP = $ip \n
Browser Info: $httpagent \n
Referral: $httpref \n
";

mail("me@comcast.net", $subject, $msg, "Jill");
?>

<div align="center">Thank you for you order. If you do not receive personalized
  order confirmation from us within two business days, please call us at 555-555-5555.
</div>
<p align="center"> Date: <?php echo $todayis ?> <br />
  <?php echo $ip ?> <br />
  <br />
  <a href="sportsposters"> Next Page </a> </p>

Share this post


Link to post
Share on other sites
Hey andy- your order test came through to my email!

So then maybe this is an issue with my server???

Share this post


Link to post
Share on other sites
There's quite a few things that aren't quite right with the info that gets asked for and the info that gets sent, but that's all trivial stuff to fix later.

Fact is - it works on my server (from a client URL, but what the heck) - http://www.brianashton.ca/orderform.html - as you now know.

If you want to send me the complete order form and order form processing script (email to andy@halfadot.com), I'll get it working on my server and then - if needed - you can approach your web host and ask "how come this works on X and bombs on my server"

Share this post


Link to post
Share on other sites
Try replacing the whole thing with this and see if you are still getting similar errors.

[code]
<?php

extract($_POST);

if(!$visitormail == "" && (!strstr($visitormail,"@") || !strstr($visitormail,".")))
{
echo "<h2>Use Back - Enter valid e-mail</h2>\n";
$badinput = "<h2>Feedback was NOT submitted</h2>\n";
}
if(empty($visitor) || empty($visitormail) || empty($notes )) {
echo "<h2>Use Back - fill in all fields</h2>\n";
}
echo $badinput;

$todayis = date("l, F j, Y, g:i a") ;

$subject = $visitor;


$msg="
Name: $visitor \n
Email: $visitoremail \n
Street: $visitorstreet\n
City: $visitorcity \n
State: $visitorstreet \n
Zip Code: $visitorzipcode
Payment Method: $paymentmethod \n
Poster Style: $posterstyle \n
Poster Line: $posterline \n
Player Name: $playername \n
Colors: $colors \n
Main Text: $maintext \n
Small Text: $smalltext \n
Player Number: $playernumber \n
Main Photo: $mainphoto \n
Additional Info: IP = $ip \n
Browser Info: $httpagent \n
Referral: $httpref \n
";

mail("me@comcast.net", $subject, $msg, "Jill");

echo "<div align=\"center\">Thank you for you order. If you do not receive personalized
 order confirmation from us within two business days, please call us at 555-555-5555.
</div>
<p align=\"center\"> Date: $todayis
<a href=\"sportsposters\"> Next Page </a> </p> ";

?>
[/code]

Share this post


Link to post
Share on other sites
That gave me:

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /export/home/ji/jill/public_html/consumerorder7.php on line 3

Whatever I had before was working on Andy's server.  So I guess this is an issue with my server at this point. I'll contact them.

Thanks all so much for your help.

Share this post


Link to post
Share on other sites
It could be a lot of things. It could be your version of PHP or your error settings. You could put the line "phpInfo();" near the start of your script just temporarily and see what you can make of the info it prints out.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.