pandu Posted July 12, 2010 Share Posted July 12, 2010 Hi, I am getting a parse error on following code - not sure what is wrong. Please help echo "<strong>"; Quote Link to comment https://forums.phpfreaks.com/topic/207459-echo-error/ Share on other sites More sharing options...
BillyBoB Posted July 12, 2010 Share Posted July 12, 2010 Could we see all your code? its probably somewhere surrounding that line. Quote Link to comment https://forums.phpfreaks.com/topic/207459-echo-error/#findComment-1084630 Share on other sites More sharing options...
snizkorod Posted July 12, 2010 Share Posted July 12, 2010 maybe a ";" is missing from the line above? Are your } { closed? Quote Link to comment https://forums.phpfreaks.com/topic/207459-echo-error/#findComment-1084631 Share on other sites More sharing options...
.josh Posted July 12, 2010 Share Posted July 12, 2010 Could we see all your code? its probably somewhere surrounding that line. ^ post the code surrounding it, as well as the actual parse error. You are missing or have too many quotes, brackets, semicolons etc.. somewhere. The actual error message helps tell you what it is (not) expecting. Quote Link to comment https://forums.phpfreaks.com/topic/207459-echo-error/#findComment-1084638 Share on other sites More sharing options...
pandu Posted July 12, 2010 Author Share Posted July 12, 2010 Here is the surrounding code. One fix is to replace the double quotes with single quotes. if ($_GET["start_time"] != NULL){ $start_time_input = $_GET["start_time"]; $start_tz = $_GET["start_tz"]; $end_tz = $_GET["end_tz"]; putenv("TZ=$start_tz); $start_time = strtotime($start_time_input); echo "<strong>"; <--- Parse Error starts here. I can fix it by replacing with single quotes echo date("h:i:sA",$start_time)."\n"; <--- Also get the parse error here if I fix the above echo "</strong>"; <--- same parse error in this line... sigh... putenv("TZ=$end_tz"); Quote Link to comment https://forums.phpfreaks.com/topic/207459-echo-error/#findComment-1084640 Share on other sites More sharing options...
BillyBoB Posted July 12, 2010 Share Posted July 12, 2010 simple error if ($_GET["start_time"] != NULL){ $start_time_input = $_GET["start_time"]; $start_tz = $_GET["start_tz"]; $end_tz = $_GET["end_tz"]; putenv("TZ=$start_tz"); // this line had an unclosed double quote $start_time = strtotime($start_time_input); echo "<strong>"; <--- Parse Error starts here. I can fix it by replacing with single quotes echo date("h:i:sA",$start_time)."\n"; <--- Also get the parse error here if I fix the above echo "</strong>"; <--- same parse error in this line... sigh... putenv("TZ=$end_tz"); also you don't need double quotes unless you intend on including a variable like echoing out something so $name = $_GET['name'] and echo("The name is: $name"); Good Luck Quote Link to comment https://forums.phpfreaks.com/topic/207459-echo-error/#findComment-1084641 Share on other sites More sharing options...
pandu Posted July 12, 2010 Author Share Posted July 12, 2010 Hey good catch! Thanks Billy Bob! Quote Link to comment https://forums.phpfreaks.com/topic/207459-echo-error/#findComment-1084646 Share on other sites More sharing options...
BillyBoB Posted July 12, 2010 Share Posted July 12, 2010 Yep no problem. Good luck with the rest of your code and have fun. Quote Link to comment https://forums.phpfreaks.com/topic/207459-echo-error/#findComment-1084648 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.