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(); ?> Quote Link to comment 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'; Quote Link to comment Share on other sites More sharing options...
revraz Posted August 5, 2008 Share Posted August 5, 2008 echo "<img src='$url'><br>"; Quote Link to comment 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. Quote Link to comment 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? Quote Link to comment 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 Quote Link to comment 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. Quote Link to comment 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.