|
Posted by NC on 01/12/06 03:51
Bob Marley wrote:
> would anyone please tell me why this code works in 4.X, 5.0.X
> and not in 5.1?
>
> <?php
> function myfunction(){
>
> *** php code ***
> ?>
> <a href="bla.bla">bla</a>
> <?
> *** php code ***
>
> }
>
> ?>
>
> when i run it under 5.1 i get the error "Parse error: syntax error,
> unexpected $end in" on the last line of the file. i drop the embedded
> html and it works fine.
Most likely, it has nothing to do with PHP version, but rather with
your use of "<?" opening tag. Change it to "<?php" and see if it
solves the problem. If it does, it means your short_open_tag directive
is set to 0 and you must either change all "<?" tags to "<?php" tags or
set short_open_tag to 1.
Cheers,
NC
[Back to original message]
|