Forum Moderators: coopster

Message Too Old, No Replies

Need help with simple error

Newbie question

         

ml7555

6:20 am on Jul 25, 2009 (gmt 0)

10+ Year Member



I have the following code in document called "94602weather.php":

<?php
$url="http://weather.yahoo.com/forecast/USCA0860.html"; //Yahoo Weather URL. Sub USCA0860 for your code.

$divStart = "<div class="forecast-icon";">$strEnd = "'); _background-image/* */: none;";
$start = strpos($file_contents, $divStart) + 50;
$end = strpos($file_contents, $strEnd);
$length = $end-$start;

$imagepath=substr($file_contents, $start , $length); //Pulls path to image
$image=imagecreatefrompng($imagepath); //Pulls image source into PHP
imagealphablending($image, true); //Enable alpha blending (important)
imagesavealpha($image, true); //Applies alpha to image.

header('Content-Type: image/png'); //Identifies itself as a PNG image
imagepng($image); //Outputs image contents
?>

I am getting the following error:

Parse error: parse error, unexpected T_STRING in /home/orange01/public_html/ml_scripts/94602weather.php on line 4

Anything look obviously wrong in the code? Thanks!

ml7555

10:10 pm on Jul 25, 2009 (gmt 0)

10+ Year Member



Okay. Problem has been resolved.