Welcome to Geeklog, Anonymous Monday, December 30 2024 @ 12:55 pm EST

Geeklog Forums

Moving from Left to Right and PHP problem


Nathan Burke

Anonymous
confused
Hi.
I'm trying to move a block from the left to the right, but I'm experiencing a weird problem. I have a block on the left that grabs links using PHP code, and it works perfectly.
Text Formatted Code
<?php
$db = mysql_connect("localhost", "*****", "*****");
mysql_select_db("geeklog", $db);

$result = mysql_query("SELECT * FROM gl_links ORDER BY title ASC", $db);

while ($myrow = mysql_fetch_array($result))

        {
echo "<a href='".$myrow["url"]."'  target='_new'>".$myrow["title"]."</a><br>";
}

?>
 


But, when I make one simple change, moving from the left to the right, instead of having a nice little list of links, only the following displays:

Blogs I Read
".$myrow["title"]."
"; } ?>


So for some reason, just switching from right to left tells geeklog not to display the generated html but instead just display the code. Any idea where I could change this?

Thank You.
nathan
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
PHP code is not supported in normal blocks. It only happens to work because PHP is also allowed in header.thtml and the left blocks are included from header.thtml.

I'm actually surprised that this works when you add PHP code as the block's content and would consider it a bug.

Solution: Use a PHP block, that's what they're for.

bye, Dirk
 Quote

All times are EST. The time is now 12:55 pm.

  • 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