Damn im stuck, php tags

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
.Stealth
Forum Commoner
Posts: 57
Joined: Wed Jan 10, 2007 12:15 pm
Location: Manchester, England

Damn im stuck, php tags

Post 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.
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post 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.
.Stealth
Forum Commoner
Posts: 57
Joined: Wed Jan 10, 2007 12:15 pm
Location: Manchester, England

Post 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 :)
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post 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
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post 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.
Post Reply