Jump to content

Echo error


pandu

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/207459-echo-error/#findComment-1084638
Share on other sites

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");

 

Link to comment
https://forums.phpfreaks.com/topic/207459-echo-error/#findComment-1084640
Share on other sites

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

Link to comment
https://forums.phpfreaks.com/topic/207459-echo-error/#findComment-1084641
Share on other sites

Archived

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

×
×
  • Create New...

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.