View Full Version : Quick Code Help

05-17-2011, 05:24 AM
Hi All,

I have a site where the admin area has a backside PHP / SQL language and is supposed to upload a product image from the applet embedded into the page, but the page opens to a SYNTAX ERROR and I can not tell if the applet would work to add to the SQL DB TABLE for the product image until I get the page working.

Can one of you smart people help me out as it might take you two seconds to review and correct this page code and me a year!!

The SYNTAX ERROR I get is:

Parse error: syntax error, unexpected '{' in /home/xxxxxxx/public_html/admin/modules/catalog/base_add_pic.php on line 37 and line 37 in the code below begins with:


Thanks in advance,

Here is the page code if anyone can check to see if the page will encounter more and more syntax errors:



include realpath(dirname(__FILE__) . DIRSEP . '..' . DIRSEP . '..' . DIRSEP) . DIRSEP . "includes" . DIRSEP . "nav" . DIRSEP . "header2.php";

if (isset($_POST['base_id'])){
$base_id =$_GET['base_id'];
$dir = '../../../'.$config['products_dir'];
$e->setError("No Base ID POSTED");

//check if base_id is valid from GET

$sql = "SELECT * FROM pr_base_info WHERE base_id = '$base_id'";



if($count == 1){

//find any associated pics
$sql = "SELECT * FROM pr_base_pics where base_id = '$base_id'";
if ($count>=1){
} else {

$e->setError("Sub group Id value is invalid");

if($POST['action']== 'delete'){

if (isset($POST['pic_name'])){
$pic_name = $POST['pic_name'].'.jpg';


$delete_sql = "DELETE * FROM pr_base_pics WHERE pic_name = '$pic_name'";


$e->setError("$subgroup_name has been deleted...please wait.");


<script type="text/javascript" language="javascript">

setTimeout('window.top.location.reload();parent.parent.GB_hide();', 1000);



<br /><br />

<?php $e->showErrors();?>



$e->setError("no pic name given to delete!");

}elseif($POST['action']== 'add'){

$e->setError("Bad Action Posted");


<center><span class="title">Delete <?php echo $subgroup_name ?>?</span><br />

<?php $e->showErrors(); ?>

<form method="post" action="">

<table border='0' cellpadding='4'>


<td><?php echo "WARNING deleting this item will delete any assocaited pictures and it's extended items" ?></td>

<td><input type="submit" value="Delete <?php echo $short_desc ?>" /><input type="hidden" name="action" value="delete" /></td>

<td><input type="button" value="Cancel Deletion" onclick="parent.parent.GB_hide();" /></td>



<applet id="jumpLoaderApplet" name="jumpLoaderApplet"
archive="<?php echo $config['admin_url'] ?>modules/catalog/mediautil_z.jar,sanselan_z.jar,jumploader_z.jar"
<param name="uc_sendImageMetadata" value="true"/>
<param name="uc_imageEditorEnabled" value="true"/>
<param name="uc_useLosslessJpegTransformations" value="true"/>
<param name="uc_uploadUrl" value="<?php echo $config['admin_url'] ?>modules/catalog/partitionedUploadHandler.php"/>
<param name="uc_uploadScaledImages" value="true"/>
<param name="uc_scaledInstanceNames" value="small,medium,large"/>
<param name="uc_scaledInstanceDimensions" value="100x100,200x200,400x400"/>
<param name="uc_scaledInstanceQualityFactors" value="900,800,700"/>
<param name="uc_scaledInstanceQualityFactors" value="900,800,700"/>
<param name="ac_fireUploaderFileAdded" value="true"/>
<param name="ac_fireUploaderFileStatusChanged" value="true"/>
<param name="uc_fileNamePattern" value="^.+\.(?i)((jpg)|(jpe)|(jpeg)|(gif)|(png)|(tif)|(tiff))$"/>
<param name="vc_fileNamePattern" value="^.+\.(?i)((jpg)|(jpe)|(jpeg)|(gif)|(png)|(tif)|(tiff))$"/>
<param name="vc_disableLocalFileSystem" value="false"/>
<param name="vc_mainViewFileTreeViewVisible" value="true"/>
<param name="vc_mainViewFileListViewVisible" value="true"/>
<param name="uc_imageRotateEnabled" value="true"/>
<param name="uc_scaledInstancePreserveMetadata" value="true"/>
<param name="uc_deleteTempFilesOnRemove" value="true"/>



include realpath(dirname(__FILE__) . DIRSEP . '..' . DIRSEP . '..' . DIRSEP) . DIRSEP . "includes" . DIRSEP . "nav" . DIRSEP . "footer2.php";


05-17-2011, 05:48 AM

You missed a closing bracket

05-17-2011, 08:17 AM
Dang it... I looked at all the brackets!! How did I miss that?

Thanks greatly... That works.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum