Short Tag Problems

PythonPython Forum LeaderThe Royal RAM
My current host doesnt allow PHP short tags(<? instead of <?php) which is mainly why im switching hosts but what is the solution to this problem?

Heres the original code:
[PHP]<?= $message ?>[/PHP]

Now if i simply replace <? with <?php it wont work. It throws up an unexpected error. How can I rewrite the above to do the same thing but so it works with <?php tags?

Thanks

The Royal Ram

Comments

  • angrylizardangrylizard Junior Member Shared Hoster
    well that statement is invalid so I'm assuming the $message just means some code but anyway, this is proper syntax:

    <?php code here ?>

    And if you want the variable $message displayed, it'd be this:

    <?php print($message); ?>
  • PythonPython Forum Leader The Royal RAM
    heres an example of it in use:

    <input type=text size=40 name=base_path value="<?= $base_path ?>

    That is simply a text input box where the value is $base_path. Now usually I would solve this by simply doing what you done and echo it out however this has an = sign before it which i dont know why

    The Royal Ram

  • PythonPython Forum Leader The Royal RAM
    ohh actually. i just tried it out and it worked fine :)

    sorry, my mistake, hehe

    The Royal Ram

  • angrylizardangrylizard Junior Member Shared Hoster
    I'm confused but... Hey, it works, so cool
  • PythonPython Forum Leader The Royal RAM
    to clear the confusion....

    I just echoed out the variables and it was sorted...first time I done this it didnt work...I think I might have missed something first time round,

    The Royal Ram

  • ForgeForge Senior Member The Royal RAM
    I did that once, when i was once a newb. But then i got smart.. (er)
    Can fat people Go skinny Dipping?
Sign In or Register to comment.