Page 1 of 1

Damn im stuck, php tags

Posted: Thu Jan 11, 2007 10:55 pm
by .Stealth
Hi guys, just need a little help.

my host has there php set up wierd.

if you have php anywhere that is inbetween this:
<? stuff here ?>

it wont work and it just prints out whats between.



if you do it like this:

<?php stuff here ?>

it works perfectly, but ive got a problem, ive got a script to list files in a directory and be able to delete them, but for the script to list them it needs to be like this:

<?=$filelist?>

if i do it like this:

<?php=$filelist?>

it just dosent work, is there a way around this? thanks.

Posted: Thu Jan 11, 2007 11:06 pm
by Kieran Huggins
http://www.php.net/manual/en/ini.core.p ... t-open-tag

You can replace the <?= $something?> with <?php echo $something?>

Or you can ask if your host supports php.ini in your web directory.

Posted: Thu Jan 11, 2007 11:13 pm
by .Stealth
ohh cool, thanks for that, so its just a lazy way of echoing? i didnt write the code, im just modyfiying it to suit my needs.

thanks :)

Posted: Fri Jan 12, 2007 1:27 am
by John Cartwright
.Stealth wrote:ohh cool, thanks for that, so its just a lazy way of echoing? i didnt write the code, im just modyfiying it to suit my needs.

thanks :)
Classic case why "lazy echoing" should never be used Image

Posted: Fri Jan 12, 2007 1:30 am
by Chris Corbyn
Jcart wrote:
.Stealth wrote:ohh cool, thanks for that, so its just a lazy way of echoing? i didnt write the code, im just modyfiying it to suit my needs.

thanks :)
Classic case why "lazy echoing" should never be used Image
I second that... your host has done you a favour by turning off short tags IMO.