我如何获得运行Php脚本的链接? [英] How do i get a link to run a Php script?

查看:73
本文介绍了我如何获得运行Php脚本的链接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿,有没有人知道我不能得到一个href链接运行PHP脚本?像href dosent change页面刚刚运行上面的PHP脚本?任何指针都会很好:)

Hey, does anyone know how i cant get a href link too run a PHP script? Like the href dosent change page just runs a PHP script above? Any pointers would be great :))

推荐答案

如果你链接到一个脚本,在执行一些代码后,告诉浏览器重定向到您的主页面,您将实现该目标。

If you link to a script which, after executing some code, tells the browser to redirect back to your main page, you will achieve that.

示例:

example:

<?php 
  //some code...

  header("Location: $_SERVER['HTTP_REFERER']");
?>

这是一种方式。它不适用于每台服务器。

It's one way to do it. It doesn't work on every server.

或者,您可以硬编码您的网址,例如:

Alternatively, you can hardcode your url, like:

header("Location: path/to/the/page/you/want/to/go/back/to");

这篇关于我如何获得运行Php脚本的链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆