Parse error: syntax error, unexpected $end

wd-media

No avatar

2007-05-23 09:58

When I press Products in the admin areea I get this error:


Parse error: syntax error, unexpected $end in /home/forma/public_html/cms/mag/core/products-admin.php on line 1

» Quick.Cart v2.x

merci

No avatar

2007-05-23 10:06

wd-media - paste the code from file core/products-admin.php (the beginning of the file) or maybe first try upload files again on server and check if you have binary mode while doing it.

wd-media

No avatar

2007-05-23 10:20

<?php
if( !function_exists( 'saveProduct' ) ){
/**
* Save product
* @return void
* @param array $aForm
*/
function saveProduct( $aForm ){

if( is_numeric( $aForm['iProduct'] ) ){
if( isset( $aForm['aFilesDescriptionChange'] ) && is_array( $aForm['aFilesDescriptionChange'] ) ){
foreach( $aForm['aFilesDescriptionChange'] as $iKey => $sValue ){
dbChangeFileData( Array( $iKey, $aForm['iProduct'], $aForm['aFilesNameChange'][$iKey], changeTxt( ereg_replace( '\'', '', $sValue ) ), $aForm['aFilesType'][$iKey], $aForm['aFilesPositionChange'][$iKey] ), 1 );
} // end foreach
}
$bExist = true;
}
else{
$bExist = null;
$aForm['iProduct'] = throwLastId( ) + 1;
}

if( !isset( $aForm['iPosition'] ) || !is_numeric( $aForm['iPosition'] ) || $aForm['iPosition'] < -99 || $aForm['iPosition'] > 999 )
$aForm['iPosition'] = 0;

$aForm['sDescriptionShort'] = changeTxt( $aForm['sDescriptionShort'], 'Nds' );
$aForm['sDescriptionFull'] = changeTxt( $aForm['sDescriptionFull'], 'Nds' );

$aForm['sName'] = changeTxt( $aForm['sName'] );
$aForm['fPrice'] = ereg_replace( ',', '.', $aForm['fPrice'] );
$aForm['fPrice'] = tPrice( $aForm['fPrice'] );

if( isset( $aForm['aDelFiles'] ) && is_array( $aForm['aDelFiles'] ) ){
$iCount = count( $aForm['aDelFiles'] );
for( $i = 0; $i < $iCount; $i++ )
delFile( $aForm['aDelFiles'][$i], 1 );
}

if( isset( $aForm['aCategories'] ) && is_array( $aForm['aCategories'] ) ){
$bErase = true;
$iCount = count( $aForm['aCategories'] );
for( $i = 0; $i < $iCount; $i++ ){
if( is_numeric( $aForm['aCategories'][$i] ) ){
dbAddCategoriesProduct( $aForm['aCategories'][$i], $aForm['iProduct'], $bErase );
$bErase = null;
}
} // end for
}

addFiles( $aForm, $aForm['iProduct'], PRODUCTS_PHOTO_SIZE, 1 );
dbAddProductExtensions( Array( $aForm['iProduct'], $aForm['sDescriptionFull'] ) );
dbSaveProduct( $aForm, $bExist );
} // end function saveProduct
}

if( !function_exists( 'delProduct' ) ){
/**
* Delete product
* @return void
* @param int $iProduct
*/
function delProduct( $iProduct ){
delFiles( $iProduct, 1 );
dbDelProduct( $iProduct );
} // end function delProduct
}
?>

wd-media

No avatar

2007-05-23 10:24

I have upload again the file wit total commander and is working but before I have use core ftp.
Strange

wd-media

No avatar

2007-05-23 10:54

I have another error when I access now the index.php

Warning: main(lang/en.php) [function.main]: failed to open stream: No such file or directory in /home/forma/public_html/cms/mag/index.php on line 30

Fatal error: main() [function.require]: Failed opening required 'lang/en.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/forma/public_html/cms/mag/index.php on line 30

treewood (OpenSolution)

Avatar: treewood

2007-05-23 14:22

wd-media - read please error. You dont have file 'lang/en.php'. Download Quick.Cart and upload file en.php in lang/ directory

wd-media

No avatar

2007-05-24 09:54

I have see that but the strange thing is that the file is there, I have solved this problem using another ftp client for upload
Now I have another strange problem like when I pres on product in the admin areea it shows me a blank page no error only a white page nothing on it

merci

No avatar

2007-05-24 10:31

wd-media - some people had the same problem as you, so you could use searcher to find solution... the problem is still with uploading files. Try to upload all files using Total Commander with binary mode turn on.

mimosa

No avatar

2007-08-02 08:03

Solve my problem.. i just copy the code then open cpanel, that files and paste.. working properly.. thanks all..

Mimosa Malaysia

Back to top
about us | contact