Welcome to Geeklog, Anonymous Thursday, April 25 2024 @ 08:51 am EDT

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
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany

Tom actually wrote an FAQ for this ...

bye, Dirk

 Quote

Status: offline

gHack

Forum User
Junior
Registered: 12/20/02
Posts: 15
Location:Boulder, CO
OK, got it. Thanks for the FAQ.
 Quote

All times are EDT. The time is now 08:51 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