FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » PHP server tag help
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: PHP server tag help [message #172240 is a reply to message #172235] Mon, 07 February 2011 16:00 Go to previous messageGo to previous message
alvaro.NOSPAMTHANX is currently offline  alvaro.NOSPAMTHANX
Messages: 277
Registered: September 2010
Karma:
Senior Member
El 07/02/2011 15:08, Chee escribió/wrote:
> I havent dont PHP much and my friend ask me to setup some PHP website
> locally using wamp server.
>
>
> I am really bad at this so hope someone can help me out.
>
>
> the website i got have tags like<? echo 'test' ?> however it seems
> like my version of PHP 5.3.3 is not working well with this syntax. Is
> there a way to config wamp server to accept this?!

PHP has up to four different tags to escape escape HTML from PHP:

http://es.php.net/manual/en/language.basic-syntax.phpmode.php

The one your app is using is called "short open tag" and it's a
configurable setting:

http://es.php.net/manual/en/ini.core.php#ini.short-open-tag

If PHP runs as Apache module, you can simply create or edit an
".htaccess" file in the document root add enable it with this Apache
directive:

php_flag short_open_tag on

> I do not want to modify so many pages just to fix this.

There's no need to edit the code and I wouldn't recommend it. Rewriting
some legacy third-party code to replace short open tags can be a
daunting task even for experienced PHP programmers. And the feature is
not actually deprecated:

«Using short tags should be avoided when developing applications or
libraries that are meant for redistribution, or deployment on PHP
servers which are not under your control, because short tags may not be
supported on the target server. For portable, redistributable code, be
sure not to use short tags.»



--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://borrame.com
-- Mi web de humor satinado: http://www.demogracia.com
--
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Stats comp.lang.php (last 7 days)
Next Topic: String Replacement
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Tue Nov 26 08:26:15 GMT 2024

Total time taken to generate the page: 0.04539 seconds