Parse error: syntax error, unexpected ‘604800’ (T_LNUMBER) in /home/username/public_html/image.php on line 4 [on hold]

I am not good at php but have basic knowledge.

My developer has developed website for me and now I am having problem in one of the page and i am getting following error:

Parse error: syntax error, unexpected ‘604800’ (T_LNUMBER) in
/home/username/public_html/image.php on line 4

And the code of image.php file is as follows:

<?php

	include("shopmanager/Utils.php");
        Header('Expires: '.gmdate('D, d M Y H:i:s GMT', time()   604800));
                                     
	Header("Connection: keep-alive");
	
	if(!is_numeric($id)) die("");
	$flag = true;
	$image_types = Array 
	(
			array("image/jpeg","jpg"),
			array("image/pjpeg","jpg"),
			array("image/bmp","bmp"),
			array("image/gif","gif"),
			array("image/x-png","png")
	);	
	
	if($id == 0 || $id == 1 || $id == -1|| $id == -2)
	{
		Header ("Content-type: image/gif");
		$handle = fopen("images/no_pic.gif", "rb");
		$contents = fread($handle, filesize("images/no_pic.gif"));
		fclose($handle);
		print $contents;
		$flag=false;
	}
	
	if($flag)
	{
		foreach($image_types as $image_type)
		{
			if(file_exists("uploaded_images/".$id.".".$image_type[1])) 
			{
				Header ("Content-type: ".$image_type[0]);
				$handle = fopen("uploaded_images/".$id.".".$image_type[1], "rb");
				$contents = fread($handle, filesize("uploaded_images/".$id.".".$image_type[1]));
				fclose($handle);
				print $contents;
				$flag=false;
			}
		}
	}
?>
	if($flag)
	{	
		mysql_connect("$DBHost","$DBUser","$DBPass");
		mysql_select_db ($DBName) or die ("DB does not exist or access is denied!");					
		$sql = "SELECT * FROM ".$DBprefix."image WHERE image_id=$id";
		
		$result = mysql_query ($sql);					
		if (mysql_num_rows ($result)>0) 
		{
			$row = @mysql_fetch_array ($result);
			if ($row["image_file"] != ''){
				$image_type = $row["image_type"];
				$image = $row["image_file"];				
				Header ("Content-type: $image_type");
				if (isset($thumb) && $thumb == 1)
					$imgPath = 'uploads/thumbnails/';
				else
					$imgPath = 'uploads/';
				$handle = fopen($imgPath.$image, "rb");
				$contents = fread($handle, filesize($imgPath.$image));
				fclose($handle);
				print $contents;
			}else{
				$image_type = $row["image_type"];
				$image = $row["image"];				
				Header ("Content-type: $image_type");
				print $image;
			}
		}
		mysql_close();
	}

?>

so can anyone suggest me what is wrong in this code?

Regards,


Source: syntax

Leave a Reply