Jump to content


Refresh part of a page

  • Please log in to reply
2 replies to this topic

#1 sirio

  • New Members
  • Pip
  • Newbie
  • 8 posts

Posted 27 September 2006 - 08:28 PM

I posted this in the wrong forum of this website, so i repeat:
I'm running my website with php-nuke, n my forums are the well known phpbb forums.
In the main page of my website, i have a script that shows the last topics in the forums... so i wanted to know if it is possible to refresh ONLY that part of the page (and not the parent page) clicking on a link or button. Maybe in php? javascript?...

I've been searching, and i found nothing.

Somebody suggested me to use ajax, but i want a better way to solve this.


#2 chopperwalker

  • New Members
  • Pip
  • Newbie
  • 7 posts

Posted 28 September 2006 - 01:01 AM

You could use an iframe and simply have a refresh link that targets it. Other than that you would probably have to use an http_request and some javascript ("ajax");
PHP Version 4.3.11, MySQL 4.0.24, Apache/1.3.33

#3 sirio

  • New Members
  • Pip
  • Newbie
  • 8 posts

Posted 28 September 2006 - 02:45 PM

ok, i've made an iframe to do it, but i get an error message.

In index.php, i wrote:
<iframe src="foros.php" width="100%" height="200"></iframe>

and when i run the index, i get this:

Fatal error: Call to a member function on a non-object in /data/members/free/tripod/es/l/a/t/latinquasar/htdocs/foros.php on line 28

Line 28:

$result = $db->sql_query( "SELECT t.topic_id, t.topic_first_post_id, t.forum_id, t.topic_last_post_id,
t.topic_title, t.topic_poster, t.topic_views, t.topic_replies, t.topic_moved_id, p.poster_id,
p.post_time, u.username, l.username, u.user_id, tx.post_text, p.post_username, f.post_username
FROM ".$prefix."_bbtopics AS t
LEFT JOIN ".$prefix."_bbposts AS p ON (p.post_id = t.topic_last_post_id)
LEFT JOIN ".$prefix."_bbposts AS f ON (f.post_id = t.topic_first_post_id)
LEFT JOIN ".$prefix."_bbposts_text AS tx ON (p.post_id = tx.post_id)
LEFT JOIN ".$user_prefix."_users AS u ON (u.user_id=p.poster_id)
LEFT JOIN ".$user_prefix."_users AS l ON (l.user_id=t.topic_poster)
ORDER BY t.topic_last_post_id DESC LIMIT 0, $Last_New_Topics");

foros.php is just a block in phpnuke.

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users