douruduan8812 2011-12-24 11:31
浏览 66

如何在页面加载到php文件时模拟click事件

i have been trying to figure out how to simulate a click event and pass it to a php file.

i want a click to passed to the following url on page load without any user interaction means on page load event.

http://www.xyz.com/jq.php?href=http://www.abc.com/xyz
  • 写回答

1条回答 默认 最新

  • dongqiong8021 2011-12-24 11:44
    关注

    You can use good old HTTP for that (which is also very search engine friendly), either with PHP:

    <?php
      header("HTTP/1.1 301 Moved Permanently");
      header("Location: http://www.xyz.com/jq.php?href=http://www.abc.com/xyz");
    

    Or via .htaccess, with something like this (which works the same way, I guess):

    ## redirect index.php to the new domain
    Redirect 301 /index.php http://www.xyz.com/jq.php?href=http://www.abc.com/xyz
    

    Or something like this (if you're on an Apache and have mod_rewrite enabled):

    RewriteEngine on
    ## redirect everything to the new domain:
    RewriteRule (.*) http://www.xyz.com/jq.php?href=http://www.abc.com/xyz/$1 [R=301,L] 
    
    评论

报告相同问题?

悬赏问题

  • ¥15 vue3+element-plus页面崩溃
  • ¥15 像这种代码要怎么跑起来?
  • ¥15 怎么改成循环输入删除(语言-c语言)
  • ¥15 安卓C读取/dev/fastpipe屏幕像素数据
  • ¥15 pyqt5tools安装失败
  • ¥15 mmdetection
  • ¥15 nginx代理报502的错误
  • ¥100 当AWR1843发送完设置的固定帧后,如何使其再发送第一次的帧
  • ¥15 图示五个参数的模型校正是用什么方法做出来的。如何建立其他模型
  • ¥100 描述一下元器件的基本功能,pcba板的基本原理