Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Parse error: syntax error, unexpected T_IF in /home/********/public_html/catalog/addy/orders.php on line 396


Guest

Recommended Posts

Posted

Hello,

 

I'm getting this error when clicking on orders in admin?

 

Parse error: syntax error, unexpected T_IF in /home/wihirt/public_html/catalog/******/orders.php on line 396

 

	    $contents[] = array('text' => '<br />' . TEXT_DATE_ORDER_CREATED . ' ' . tep_date_short($oInfo->date_purchased)) if (tep_not_null($oInfo->last_modified)) $contents[] = array('text' => TEXT_DATE_ORDER_LAST_MODIFIED . ' ' . tep_date_short($oInfo->last_modified));

This is what's on line 396

 

Please advise

 

Cheers

Posted

It looks like you have at least two statements run together. Add a ; before the "if" and split the line there for easier reading. You'll end up with

$contents[] = array('text' => '<br />' . TEXT_DATE_ORDER_CREATED . ' ' . tep_date_short($oInfo->date_purchased));
if (tep_not_null($oInfo->last_modified)) $contents[] = array('text' => TEXT_DATE_ORDER_LAST_MODIFIED . ' ' . tep_date_short($oInfo->last_modified));

which is at least legal PHP. I don't know what the original logic is supposed to be (I don't have unmodified code in front of me) so I can't promise this will work as expected.

 

Even if that's what the code is supposed to be, it's pretty sloppy programming. It would be more efficient to have

if (tep_not_null($oInfo->last_modified))
 $contents[] = array('text' => TEXT_DATE_ORDER_LAST_MODIFIED . ' ' . tep_date_short($oInfo->last_modified));
else
 $contents[] = array('text' => '<br />' . TEXT_DATE_ORDER_CREATED . ' ' . tep_date_short($oInfo->date_purchased));

Posted

After MrPhil has answered a question, there isn't much left to say. But if that is your correct admin directory name, as here published, then you may want to change it.

Posted

After MrPhil has answered a question, there isn't much left to say. But if that is your correct admin directory name, as here published, then you may want to change it.

 

No I replaced it with *****

 

Cheers

Posted

I think Chris is concerned about the part between /home/ and /public_html/ (your Hosting Account Name). Potentially, someone sharing your server could use that information to poke around your site, or even overwrite something, as they would know the complete file path to your directories and files. Even if you have your permissions set so no one can write to your files, it's an extra layer of security not to give out your account name.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...