Topics

User Functions

Events

There are no upcoming events

What's New

Stories

No new stories

Comments last 2 weeks


Trackbacks last 2 weeks

No new trackback comments

Links last 2 weeks

No recent new links

NEW FILES last 14 days

No new files

Welcome to Geeklog Thursday, June 20 2013 @ 12:59 AM EDT


 Forum Index > Extensions > PHP Blocks New Topic Post Reply
 Moving from Left to Right and PHP problem
   
Anonymous: Nathan Burke
 02/03/06 11:28AM (Read 1733 times)  

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.
PHP 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
Dirk
 02/03/06 02:24PM  
AAAAA
Admin

Status: offline


Registered: 01/12/02
Posts: 13035
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

 
Profile Email Website
 Quote
Content generated in: 0.74 seconds
New Topic Post Reply

Normal Topic Normal Topic
Sticky Topic Sticky Topic
Locked Topic Locked Topic
New Post New Post
Sticky Topic W/ New Post Sticky Topic W/ New Post
Locked Topic W/ New Post Locked Topic W/ New Post
View Anonymous Posts 
Able to post 
Filtered HTML Allowed 
Censored Content