开发者

PHP disclaimer script

I was wondering: what is the PHP equivalent of this JavaScript code:

window.onload = initAll;

function initAll() {
  document.getElementById("开发者_开发百科redirect").onclick = clickHandler;
}

function clickHandler() {

  if(this.toString().indexOf("wapcreate") < 0){
    window.location = "ex.html";
  }

  return false;
}

I want to get all the external links from my server and then direct the users to a disclaimer page


There is no PHP equivalent, because PHP is executed on the server, while Javascript is executed on the client-side. There is no way for PHP to to handle an onclick event.

But if you want to redirect a page, try to set a header like this:

header( 'Location: ex.html' );
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜