Welcome to Geeklog, Anonymous Sunday, December 22 2024 @ 11:18 am EST
Geeklog Forums
PHP and staticpages 1.2
Status: offline
gHack
Forum User
Junior
Registered: 12/20/02
Posts: 15
Location:Boulder, CO
Hi,
I've installed staticpages 1.2, successfully got the database upgraded by applying updb.sql to it, my regular old static pages are displaying fine, etc.
I'm trying to figure out what kinds of PHP will work with the new static pages. I've searched through this site trying to find similar questions and ended up getting more confused. Possibly I will ask this question and then figure it out myself before anybody responds. That's the way it is sometimes.
So here's my problem:I'm trying to insert a PHP variable into the HTML that will fill in the site URL wherever I need it with whatever's in $_CONF['site_url'] at the time.
I've tried:
<?php
$STATIC_URL = $_CONF['site_url'];
?>
<img src="<?=$STATIC_URL?>/layout/etc...">
And that doesn't work. I've also tried using <?php echo $STATIC_URL; ?> and have tried enclosing the entire HTML display in here-doc format, but I get the same result every time -- the resultant HTML displays the PHP code within the <img> tag unchanged. I've also tried inserting $_CONF['site_url'] without the initial PHP code at the top and I get the same results.
Additionally, when I enclose all of the code in <?php ?> tags and use here-doc notation for the HTML, my EOT delimiter shows up in the HTML display along with the final ?>. However, if I leave these two things out, I get an error, as expected.
How do I simply insert a PHP variable for display within some HTML?
Thanks,
Chris
6
8
Quote
All times are EST. The time is now 11:18 am.
- Normal Topic
- Sticky Topic
- Locked Topic
- New Post
- Sticky Topic W/ New Post
- Locked Topic W/ New Post
- View Anonymous Posts
- Able to post
- Filtered HTML Allowed
- Censored Content