简体   繁体   English

在启动php之前回显消息并激活按钮?

[英]Before starting php echo a message and activate button?

How do I activate stages of php, for example the user opens the php file. 我如何激活php阶段,例如用户打开php文件。 And before starting the script they are asked "are you sure you want to continue". 在启动脚本之前,系统会询问他们“确定要继续”。 With a button below staying activate. 使用下面的按钮保持激活状态。

I have already looked around and I'm sure there is a way to do it but I don't know what it is called. 我已经环顾四周,我敢肯定有办法做到这一点,但我不知道它叫什么。 Could someone help me out? 有人可以帮我吗?

.Short way to do that: 这样做的捷径:

if($_GET['execute'] == 'yeah') {
    // your php-file-content goes here....
    // ....
} else {
    echo '<a href="'.$_SERVER["PHP_SELF"].'?execute=yeah">Are you sure you want to execute this file?</a>'.PHP_EOL;
}

Just put your filecontent between the IF part. 只需将文件内容放在IF部分之间即可。 It wont be executed untill the request ist yourfilename.php?execute=yeah 直到请求到yourfilename.php?execute = yeah才会执行

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM