PHP在線調(diào)試執(zhí)行的實現(xiàn)方法(附demo源碼)
來源:易賢網(wǎng) 閱讀:1396 次 日期:2016-08-25 15:37:16
溫馨提示:易賢網(wǎng)小編為您整理了“PHP在線調(diào)試執(zhí)行的實現(xiàn)方法(附demo源碼)”,方便廣大網(wǎng)友查閱!

本文實例講述了PHP在線執(zhí)行的實現(xiàn)方法。分享給大家供大家參考,具體如下:

運行效果截圖如下:

名單

run.php文件如下:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>調(diào)試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 代碼調(diào)試</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" style=" width:60px;">執(zhí)行</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程序設(shè)計有所幫助。

更多信息請查看網(wǎng)絡(luò)編程
由于各方面情況的不斷調(diào)整與變化,易賢網(wǎng)提供的所有考試信息和咨詢回復(fù)僅供參考,敬請考生以權(quán)威部門公布的正式信息和咨詢?yōu)闇?zhǔn)!
關(guān)于我們 | 聯(lián)系我們 | 人才招聘 | 網(wǎng)站聲明 | 網(wǎng)站幫助 | 非正式的簡要咨詢 | 簡要咨詢須知 | 加入群交流 | 手機站點 | 投訴建議
工業(yè)和信息化部備案號:滇ICP備2023014141號-1 云南省教育廳備案號:云教ICP備0901021 滇公網(wǎng)安備53010202001879號 人力資源服務(wù)許可證:(云)人服證字(2023)第0102001523號
云南網(wǎng)警備案專用圖標(biāo)
聯(lián)系電話:0871-65317125(9:00—18:00) 獲取招聘考試信息及咨詢關(guān)注公眾號:hfpxwx
咨詢QQ:526150442(9:00—18:00)版權(quán)所有:易賢網(wǎng)
云南網(wǎng)警報警專用圖標(biāo)