You are here: help catch the error « All PHP « IT news, forums, messages
help catch the error

Posted by Ashok on 06/28/05 13:25

Hi,
I am getting parse error, but can't find where the error lies. If anyone can
help me catch the error.
Here is the code:
<?php
require('includes/application_top.php');
$navigation->remove_current_page();
$products_query = tep_db_query("select pd.products_name, p.products_image
from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_DESCRIPTION . "
pd on p.products_id = pd.products_id where p.products_status = '1' and
p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and
pd.language_id = '" . (int)$languages_id . "'");
$products = tep_db_fetch_array($products_query);

//define paths to border images
define("BOT","images/bagetb.gif");
define("TOP","images/bagett.gif");
define("LEFT","images/bagetl.gif");
define("RIGHT","images/bagetr.gif");
define("TOP_LEFT","images/bagettopleft.gif");
define("TOP_RIGHT","images/bagettr.gif");
define("BOT_RIGHT","images/bagetbr.gif");
define("BOT_LEFT","images/bagetbl.gif");

function ds($image,$dsw,$alt){
//first check that file exists
if(file_exists($image)){
//create an image from the file
list ($width,$height)= getimagesize($image);
//print containing <div> using image width plus shadow width
print "<div style='width:
".($dsw+$width+$dsw)."\n'>";
//print topleftcorner
print "<img style='float: none;' src='".TOP_LEFT."'
height='$dsw' width='$dsw'alt=''>";
//print topline
print "<img style='float: none;' src='".TOP."' height='$dsw'
width='".$width."'alt=''>";
//print toprightcorner
print "<img style='float: none;' src='".TOP_RIGHT."'
height='$dsw' width='$dsw'alt=''>";
//print leftline
print "<img style='float: none;' src='".LEFT."'
height='".$height."' width='$dsw'alt=''>";
//print image
print "<img style='float: none;' src='$image'
height='".$height."' width='".$width."'alt='$alt'>";
//print right shadow using image sizes
print "<img style='float: none;'
src='".RIGHT."'height='".$height."'width='$dsw'alt=''>";
//print bottomleftcorner
print "<img style='float: none;' src='".BOT_LEFT."'
height='$dsw' width='$dsw'alt=''>";
//print bottom shadow using image sizes
print"<img style='float: none;'
src='".BOT."'width='".$width."'height='$dsw'alt=''>";
//print corner shadow using image sizes
print "<img style='float: none;'
src='".BOT_RIGHT."'height='$dsw'width='$dsw'alt=''>";
//print closing </div>
print "</div>";
}
else { echo" no file";}
}
?>
<head> ....
<body>
<?php ds("images/$products['products_image']",100,"big magic") //this is
line 75
?>

</body>
This gives me error: Parse error: parse error, unexpected
T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING
in W:\www\magicart.npoyuc.ru\frame.php on line 75

so, I change line 75 to
<?php ds(tep_image(DIR_WS_IMAGES . $products['products_image']),100,"big
magic") ?>
<?php echo tep_image(DIR_WS_IMAGES . $products['products_image']) ;?>
//this is line 76

Now, the result shows line 75 as "no file" echoed and line 76 shows the pic.

Ashok.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация