473,327 Members | 1,976 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

<%variable%> in html template ??

Just playing around with the idea of using a html template page to seperate
the code from design. Very basic example below

<html>
<!-- hello.html -->
<body>
Hello <b><?php echo $message ?></b><br>
</body>
</html>
<?php
//hello.php
$message ="Phillip";
include("hello.html");
?>

However I am sure I have used <%message%> within the html template before
but this time it did not work. Is there something I should set-up in the
httpd.conf so Apache knows <% %> are PHP tags?

Cheers

Phil

May 16 '06 #1
10 1472

Phil Latio wrote:
Just playing around with the idea of using a html template page to seperate
the code from design. Very basic example below

<html>
<!-- hello.html -->
<body>
Hello <b><?php echo $message ?></b><br>
</body>
</html>
<?php
//hello.php
$message ="Phillip";
include("hello.html");
?>

However I am sure I have used <%message%> within the html template before
but this time it did not work. Is there something I should set-up in the
httpd.conf so Apache knows <% %> are PHP tags?

Cheers

Phil


The syntax is <%=$message%> or the more PHP-like <?=$message?>

May 16 '06 #2
> The syntax is <%=$message%> or the more PHP-like <?=$message?>

<%=$message%> fails.
<?=$message?> works.

Therefore I am sure it is now Apache not reading <% %> tags as PHP.

Cheers

Phil
May 16 '06 #3

Phil Latio wrote:
The syntax is <%=$message%> or the more PHP-like <?=$message?>


<%=$message%> fails.
<?=$message?> works.

Therefore I am sure it is now Apache not reading <% %> tags as PHP.

Cheers

Phil


asp_tags is probably turned off in php.ini. That's the default I
believe.

May 16 '06 #4
Really, you shouldn't be using <?= either. <?php echo may be more
verbose, but it's guaranteed to work on all platforms.

May 17 '06 #5

"Chung Leong" <ch***********@hotmail.com> wrote in message
news:11*********************@i40g2000cwc.googlegro ups.com...

Phil Latio wrote:
The syntax is <%=$message%> or the more PHP-like <?=$message?>


<%=$message%> fails.
<?=$message?> works.

Therefore I am sure it is now Apache not reading <% %> tags as PHP.

Cheers

Phil


asp_tags is probably turned off in php.ini. That's the default I
believe.


That's it.

Cheers

Phil
May 17 '06 #6

"Ambush Commander" <ed*********@gmail.com> wrote in message
news:11********************@i39g2000cwa.googlegrou ps.com...
Really, you shouldn't be using <?= either. <?php echo may be more
verbose, but it's guaranteed to work on all platforms.


I am sure you are correct but wanted this answered simply because I thought
I was going senile.

Cheers

Phil
May 17 '06 #7
Carved in mystic runes upon the very living rock, the last words of Chung
Leong of comp.lang.php make plain:

Phil Latio wrote:
> The syntax is <%=$message%> or the more PHP-like <?=$message?>


<%=$message%> fails.
<?=$message?> works.

Therefore I am sure it is now Apache not reading <% %> tags as PHP.

asp_tags is probably turned off in php.ini. That's the default I
believe.


Heck, I thought ASP tag support had been discontinued. What was the
reason for it in the first place?

--
Alan Little
Phorm PHP Form Processor
http://www.phorm.com/
May 17 '06 #8
Alan Little wrote:
Heck, I thought ASP tag support had been discontinued. What was the
reason for it in the first place?


Dunno. It's not like it helps you any in converting an ASP page to
PHP.

May 17 '06 #9
"Alan Little" <al**@n-o-s-p-a-m-phorm.com> wrote in message
news:Xn*************************@216.196.97.131...
Carved in mystic runes upon the very living rock, the last words of Chung
Leong of comp.lang.php make plain:
asp_tags is probably turned off in php.ini. That's the default I
believe.


Heck, I thought ASP tag support had been discontinued. What was the
reason for it in the first place?


Propably the same reason php supports this crazy asp-shit like
while ($itsRainingMen):
hallelujah();
endwhile;

and

if($itsRainingMen):
hallelujah();
elseif:
amen();
endif;

Perhaps it's there to help asp-coders get acustomed to the language,
dunno... A newbie-coder friend of mine showed a piece of code where he'd
used those and sure they work, but it's just ugly as hell like any
asp-syntax is.

--
"ohjelmoija on organismi joka muuttaa kofeiinia koodiksi" -lpk
sp**@outolempi.net | Gedoon-S @ IRCnet | rot13(xv***@bhgbyrzcv.arg)
May 17 '06 #10
Kimmo Laine wrote:
"Alan Little" <al**@n-o-s-p-a-m-phorm.com> wrote in message
news:Xn*************************@216.196.97.131...
Carved in mystic runes upon the very living rock, the last words of Chung
Leong of comp.lang.php make plain:
asp_tags is probably turned off in php.ini. That's the default I
believe.


Heck, I thought ASP tag support had been discontinued. What was the
reason for it in the first place?


Propably the same reason php supports this crazy asp-shit like
while ($itsRainingMen):
hallelujah();
endwhile;

and

if($itsRainingMen):
hallelujah();
elseif:
amen();
endif;

Perhaps it's there to help asp-coders get acustomed to the language,
dunno... A newbie-coder friend of mine showed a piece of code where he'd
used those and sure they work, but it's just ugly as hell like any
asp-syntax is.


Many PHP'ers, myself included, use the alternated syntax for bracketing
HTML, where
<? endwhile; ?> is more visible than <? } ?> and <? else: ?> looks
cleaner than <? } else { ?>.

May 17 '06 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: DC Gringo | last post by:
I'm getting a "BC30451: Name 'CRListType' is not declared." error Here's the top of the page where I'm getting stuck... <%@ Control Language="vb" AutoEventWireup="false"...
1
by: Xeon | last post by:
Hi, I'm trying this code snippet below but the parser (sablotron) returns error : <xsl:choose> <xsl:when test="some test case"> <xsl:variable name="test" select="0"/> </xsl:when>...
1
by: OM | last post by:
I've found out that I can use <div id = "variable"><div> to change text and pictures on mouseovers. All I have to do is change "variable" to be the HTML text I want. I can even change the text...
1
by: ToSam | last post by:
In my C++ program I execute a java.class file via the CreateProcess function. In details: // define a pointer to directory with Main.class file char * pExecute = "java Main"; // create a java...
8
by: Jim Moon | last post by:
Hi. I'm curious about this syntax: <variable>=function(){...} I'm not finding a definition of this syntax, but I see it used at this website:...
5
by: Steve Richter | last post by:
I have a public variable ( "mZipServiceUrl" ) in my code behind class that I am able to substitute into the HTML of the .aspx file: <span onclick="WindowOpen('<%=mZipServiceUrl%>')"...
6
by: Jeff | last post by:
Hey ASP.NET 2.0 I've added some extra properties to the Profile of users on my site. One of the new properties is of type "string" and it contain HTML data.... like for example...
4
by: dominique | last post by:
Hello All, In a wx GUI, I would like to let the user choose between >, < or =. So, I created a combobox and when the user chooses ">" for instance, I wanted to return (the objective is to send...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.