PHP not working right in 1.6.4
Posted by: guyweb (---.open.ac.uk)
Date: June 22, 2006 10:19AM

..or maybe it is working right but my code is bad. Maybe someone could enlighten me?

I am using a script that uses the following code:

<?= $NAV->to_breadcrumbs() ?>

to generate a breadcrumb. However the script is seemingly not parsed and the server outputs

to_breadcrumbs() ?>

directly to the HTML page.

Is it seeing the "->" as ending the command? Never had this problem before.

Everything worked fine in my previous version of WAMP. PHP works fine in all other respects as far as i can tell. Wordpress works fine for example.

Any help greatfully received.

Options: ReplyQuote
Re: PHP not working right in 1.6.4
Posted by: roms (---.w193-251.abo.wanadoo.fr)
Date: June 22, 2006 10:22AM

shorti_open_tags problem.

Short_open_tags have been desactivated ion wamp since 1.6.0 bevause they are not compatible with XHTML. The best is to use <?php open tags (short_open_tags might dissapear in php6). If you really want to use short_open_tags just activate them in the php.ini file.



Romain

Options: ReplyQuote
Re: PHP not working right in 1.6.4
Posted by: guyweb (---.open.ac.uk)
Date: June 22, 2006 10:54AM

Thanks roms. I never realised that! I'm usiong html 4.01 strict. Decided to stick with HTML rather than use XHTML (Ian Hickson's argument makes sense to me). Are short open tags incompatible with HTML too or just XHTML?

Even so, i tried using the long open tags too

<?php= $NAV->to_breadcrumbs() ?>

but still no joy!

Options: ReplyQuote
Re: PHP not working right in 1.6.4
Posted by: roms (---.w193-251.abo.wanadoo.fr)
Date: June 22, 2006 10:57AM

No problem with HTML, but you can have probelms with other languages like xml (open tags like <?xml ....).

<?php= is not possible, you'll have to replace by <?php echo



Romain

Options: ReplyQuote
Actually, you were totally right
Posted by: guyweb (---.open.ac.uk)
Date: June 22, 2006 11:00AM

Ive just had another look and there are tonnes of short tags in my code. Thats the problem. Ive switched them back on. Will bear in mind this issue and fix my coding!

P.S - (in the previous post) i meant:

<?php echo $NAV->to_breadcrumbs() ?>

Many thanks.



Post Edited (06-22-06 11:02)

Options: ReplyQuote
Re: Actually, you were totally right
Posted by: guyweb (---.open.ac.uk)
Date: June 22, 2006 11:04AM

Thanks again Romain, you have been a huge help. I will make sure i only use the longer tags from now on even with sticking to HTML. Great work!

Options: ReplyQuote
Re: Actually, you were totally right
Posted by: roms (---.w193-251.abo.wanadoo.fr)
Date: June 22, 2006 12:17PM

no pb ;-)



Romain

Options: ReplyQuote


Sorry, only registered users may post in this forum.