LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices



Reply
 
Search this Thread
Old 04-01-2007, 01:28 AM   #1
hiren_bhatt
Member
 
Registered: Oct 2005
Distribution: FC3,Debian
Posts: 127

Rep: Reputation: 15
Thumbs up php not being parsed properly


Well I have come across a strange problem in PHP. When I try to mix html and php the <? ?> tags are not being parsed.I exemplify this as following with output. I am using PHP 5.2.1, OS: XP and Firefox 2.0.0.3 and IE6. On my Linux system (FC3) I use PHP 4.3.9 and Firefox 1.5.9. there it works fine.

I doubt I have to change some option or parameter some where.

1. With <? ?> tags it does not work...
<?php
echo "Hello";
?>
<br />
<?
echo "How are your";
?>

Output: Hello
------------------------------------------
2. But With <?php ?> it works.

<?php
echo "Hello";
?>

<br />
<?php
echo "How are your";
?>

Output : Hello
How are you

Last edited by hiren_bhatt; 04-01-2007 at 01:29 AM.
 
Old 04-01-2007, 02:09 AM   #2
hiren_bhatt
Member
 
Registered: Oct 2005
Distribution: FC3,Debian
Posts: 127

Original Poster
Rep: Reputation: 15
Problem solved.
 
Old 04-01-2007, 02:38 AM   #3
SweetLou
Member
 
Registered: Oct 2004
Distribution: Debian Testing
Posts: 171

Rep: Reputation: 30
Thanks for letting us know how you fixed it, so when others search they can easily find the answers.

For those that need to know, you need to change your .ini file to allow short tags.
 
Old 04-01-2007, 03:20 AM   #4
hiren_bhatt
Member
 
Registered: Oct 2005
Distribution: FC3,Debian
Posts: 127

Original Poster
Rep: Reputation: 15
I should have mentioned how to do it. Thanks to bringing it to my notice.

in your php.ini file you need to allow short_open_tag,

i.e. short_open_tag = On

Note for developers:

One should try to avoid the use of short tags if things are to be redistributed. refer to php.ini for more information.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache 1.3 - .php file ain't parsed, only text misstajah Linux - Server 4 09-21-2006 07:14 AM
PHP files not getting parsed jayakrishnan Slackware 10 02-04-2006 06:11 AM
Cannot get PHP to include a class properly Dudydoo Programming 6 02-02-2006 02:03 PM
Tearing My Hair Out: PHP isnt being parsed by Apache 2!! pnh73 Linux - Software 2 01-19-2004 05:01 PM
Apache2, php code parsed as *.shtml bmar Linux - General 4 06-29-2003 05:46 AM


All times are GMT -5. The time now is 11:36 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration