ChronoEngine.com homepage

Forums

Please write a review for the extension you are using on the Joomla extensions directory before posting a new question as we are being spammed by many negative reviews.

Thank you for your support!

curly brackets fields within php error

ahmedsheeraz 29 May, 2009
Hi all, have a question here. I am trying to run a code in CC body. what i am trying is just to get the file size of a file which name is stored in database table within field file_name.

<?php $a="images/stories/{file_name}"; $b=filesize($a) ?>

later in the code i am showing $b

<?php echo $b ?>

...and its a failure.

...but if i hardcode the file name in $a lets say "images/stories/myfile.zip" then its echo the file size correctly.

why is it not working with field name.
ahmedsheeraz 29 May, 2009

<?php $a="images/stories/{file_name}"; $b=filesize($a) ?>


ah...i got the answer..... $a should b "images/stories/$row->file_name"

thanx anywayzzzzz....chrono products are awesome....I promise to buy these products if i get something from my website.
ahmedsheeraz 29 May, 2009
...now i am looking to convert the result into mb as it is in bytes right now.
This topic is locked and no more replies can be posted.

2Checkout.com

2CheckOut.com Inc. (Ohio, USA) is an authorized retailer for goods and services provided by ChronoEngine.com