PHP在线运行

index.html

 1 <!DOCTYPE html>
 2 <html>
 3 <head>
 4 <Meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 5 <title>调试PHP代码</title>
 6 </head>
 7 <style>
 8  iframe{ min-width:600px;}
 9  textarea{ max-height:600px}
10  table{ margin:0 auto;}
11 </style>
12 <body>
13 <table border="0" width="100px">
14 <tr>
15 <th>PHP 代码调试</th>
16 <th></th>
17 <th></th>
18 </tr>
19 
20 <tr>
21 
22 <form action="./run.PHP" target="run_iframe" method="post">
23 <td valign="top" align="center"><textarea name="PHP_code" cols="50" rows="43"><?PHP echo file_get_contents('./run1.PHP');?></textarea></td>
24 <td valign="middle"><button type="submit" style=" width:60px;">执行</button></td>
25 </form>
26 
27 <td valign="top"><iframe id="run_iframe" name="run_iframe" src="./run1.PHP"  height="600px"></iframe></td>
28 
29 </tr>
30 </table>
31 </body>
32 </html>

 

run.PHP

 1 <?PHP
 2     $code = stripslashes($_POST['PHP_code']);
 3           
 4     if(!strstr($code,'<?PHP'))
 5         $code = '<?PHP'.PHP_EOL.$code ;
 6         
 7     file_put_contents('run1.PHP',$code);    
 8     
 9     header("Location:./run1.PHP");
10 ?>

run1.PHP(自己创建)

源码:https://files.cnblogs.com/files/cyhms/i.zip

相关文章

统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
前言 之前做了微信登录,所以总结一下微信授权登录并获取用户...
FastAdmin是我第一个接触的后台管理系统框架。FastAdmin是一...
之前公司需要一个内部的通讯软件,就叫我做一个。通讯软件嘛...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...