本篇文章给大家分享的是有关使用PHP怎么实现一个在线调试执行功能,小编觉得挺实用的,因此分享给大家学习,希望大家阅读完这篇文章后可以有所收获,话不多说,跟着小编一起来看看吧。
run.php文件如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "/tupian/20230522/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>调试php代码</title> </head> <style> iframe{ min-width:600px;} textarea{ max-height:600px} table{ margin:0 auto;} </style> <body> <table border="0" width="100px"> <tr> <th>PHP 代码调试</th> <th></th> <th></th> </tr> <tr> <form action="./run2.php" target="run_iframe" method="post"> <td valign="top" align="center"> <textarea name="php_code" cols="50" rows="43"><?php echo file_get_contents('./run3.php'); ?></textarea> </td> <td valign="middle"><button type="submit" >执行</button></td> </form> <td valign="top"><iframe id="run_iframe" name="run_iframe" src="./run3.php" height="600px"></iframe></td> </tr> </table> </body> </html>
run2.php文件如下:
<?php $code = stripslashes($_POST['php_code']); if(!strstr($code,'<?php')) $code = '<?php'.PHP_EOL.$code ; file_put_contents('run3.php',$code); header("Location:./run3.php");
以上就是使用PHP怎么实现一个在线调试执行功能,小编相信有部分知识点可能是我们日常工作会见到或用到的。希望你能通过这篇文章学到更多知识。更多详情敬请关注创新互联行业资讯频道。
新闻标题:使用PHP怎么实现一个在线调试执行功能-创新互联
本文地址:https://www.cdcxhl.com/article6/eceog.html
成都网站建设公司_创新互联,为您提供软件开发、动态网站、全网营销推广、Google、网站制作、微信小程序
声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联