blufish Posted August 5, 2008 Share Posted August 5, 2008 Can anyone tell me why this is happening? Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/blufish/public_html/garfieldreader.php on line 12 <?php $month = $_GET['month']; $year = $_GET['year']; $syear = substr($year,-2); $day = 31; function showgarfield() { $url = 'http://images.ucomics.com/comics/ga/'.$year.'/ga'.$syear.$month.'.$day.'.gif'; echo $url; if (file_exists($url)) { echo "<img src='".$url."'><br>"; } if ($day>0) { $day = $day-1; showgarfield(); } } showgarfield(); ?> Link to comment https://forums.phpfreaks.com/topic/118208-solved-t_constant_encapsed_string-error/ Share on other sites More sharing options...
revraz Posted August 5, 2008 Share Posted August 5, 2008 $url = 'http://images.ucomics.com/comics/ga/'.$year.'/ga'.$syear.$month.$day.'.gif'; Link to comment https://forums.phpfreaks.com/topic/118208-solved-t_constant_encapsed_string-error/#findComment-608320 Share on other sites More sharing options...
revraz Posted August 5, 2008 Share Posted August 5, 2008 echo "<img src='$url'><br>"; Link to comment https://forums.phpfreaks.com/topic/118208-solved-t_constant_encapsed_string-error/#findComment-608321 Share on other sites More sharing options...
blufish Posted August 5, 2008 Author Share Posted August 5, 2008 it only prints http://images.ucomics.com/comics/ga//ga.gif when it should print http://images.ucomics.com/comics/ga/1980/800331ga.gif the 1980 and 8003 parts are from a get function. Link to comment https://forums.phpfreaks.com/topic/118208-solved-t_constant_encapsed_string-error/#findComment-608323 Share on other sites More sharing options...
Andy-H Posted August 5, 2008 Share Posted August 5, 2008 Where does the get data come from? Link to comment https://forums.phpfreaks.com/topic/118208-solved-t_constant_encapsed_string-error/#findComment-608338 Share on other sites More sharing options...
blufish Posted August 5, 2008 Author Share Posted August 5, 2008 It will be coming from a form, but now I just typed it in on the top http://www.frozenoven.com/garfieldreader.php?year=1980&month=03 Link to comment https://forums.phpfreaks.com/topic/118208-solved-t_constant_encapsed_string-error/#findComment-608340 Share on other sites More sharing options...
trq Posted August 5, 2008 Share Posted August 5, 2008 None of the variables $year, $syear, $month or $day exist within your function. Link to comment https://forums.phpfreaks.com/topic/118208-solved-t_constant_encapsed_string-error/#findComment-608341 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.