te')); return $arr; } /* 遍历用户所有主题 * @param $uid 用户ID * @param int $page 页数 * @param int $pagesize 每页记录条数 * @param bool $desc 排序方式 TRUE降序 FALSE升序 * @param string $key 返回的数组用那一列的值作为 key * @param array $col 查询哪些列 */ function thread_tid_find_by_uid($uid, $page = 1, $pagesize = 1000, $desc = TRUE, $key = 'tid', $col = array()) { if (empty($uid)) return array(); $orderby = TRUE == $desc ? -1 : 1; $arr = thread_tid__find($cond = array('uid' => $uid), array('tid' => $orderby), $page, $pagesize, $key, $col); return $arr; } // 遍历栏目下tid 支持数组 $fid = array(1,2,3) function thread_tid_find_by_fid($fid, $page = 1, $pagesize = 1000, $desc = TRUE) { if (empty($fid)) return array(); $orderby = TRUE == $desc ? -1 : 1; $arr = thread_tid__find($cond = array('fid' => $fid), array('tid' => $orderby), $page, $pagesize, 'tid', array('tid', 'verify_date')); return $arr; } function thread_tid_delete($tid) { if (empty($tid)) return FALSE; $r = thread_tid__delete(array('tid' => $tid)); return $r; } function thread_tid_count() { $n = thread_tid__count(); return $n; } // 统计用户主题数 大数量下严谨使用非主键统计 function thread_uid_count($uid) { $n = thread_tid__count(array('uid' => $uid)); return $n; } // 统计栏目主题数 大数量下严谨使用非主键统计 function thread_fid_count($fid) { $n = thread_tid__count(array('fid' => $fid)); return $n; } ?>php - How to redirect an URL to a parent iframe - Stack Overflow
最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

php - How to redirect an URL to a parent iframe - Stack Overflow

programmeradmin2浏览0评论

Im trying to redirect an user of my page when I ban him from my chat box using this (php):

header("location: index.php");
exit;

The problem is the index.php page is opening inside the connected users section, in this case inside a div. How can i redirect the user's main page ?

Thanks for your time.

Im trying to redirect an user of my page when I ban him from my chat box using this (php):

header("location: index.php");
exit;

The problem is the index.php page is opening inside the connected users section, in this case inside a div. How can i redirect the user's main page ?

Thanks for your time.

Share Improve this question edited Feb 21, 2013 at 3:36 Mollo asked Feb 20, 2013 at 16:34 MolloMollo 7233 gold badges7 silver badges25 bronze badges 6
  • rather than redirecting in the frame, you could use die("You have been banned"); instead of header(). The other option is to have a ajax/java call to check on if a redirect is needed – UnholyRanger Commented Feb 20, 2013 at 16:49
  • I just tried die("banned"); everything inside the connected users div got erased so its actually the same problem, somehow i need to do that in the parent document. I dont know about ajax hehehe – Mollo Commented Feb 20, 2013 at 16:58
  • Do you have the parent page check if the user is banned? – UnholyRanger Commented Feb 20, 2013 at 17:40
  • Ummm, good idea, i can put a check in the parent page and refresh it when i ban someone but the next question is: How to tell an specific page to refresh in php or javascript – Mollo Commented Feb 20, 2013 at 18:25
  • This may depend on what the page is used for, if a refresh occurs often, then the check will happen but if the user never refreshes you need to intervene. One way is to use java to make a check so often against the server or make the page refresh with (HTML header) <meta http-equiv="refresh" content="($seconds)">. This could get annoying to some. – UnholyRanger Commented Feb 20, 2013 at 18:32
 |  Show 1 more ment

2 Answers 2

Reset to default 8

Try this in the javascript code:

window.top.location.href = "http://www.site.";

This is the answer using javascript:

window.parent.location = "http://www.example./index.php";
发布评论

评论列表(0)

  1. 暂无评论