Implementation method of PHP online debugging and execution (with demo source code attached), demo source code_PHP tutorial

WBOY
Release: 2016-07-12 08:53:31
Original
1144 people have browsed it

The implementation method of PHP online debugging execution (with demo source code), demo source code

The example in this article describes the implementation method of PHP online execution. Share it with everyone for your reference, the details are as follows:

The screenshot of the running effect is as follows:

The run.php file is as follows:

<!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>调试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"><&#63;php
echo file_get_contents('./run3.php');
&#63;></textarea>
</td>
<td valign="middle"><button type="submit" style=" width:60px;">执行</button></td>
</form>
<td valign="top"><iframe id="run_iframe" name="run_iframe" src="./run3.php" height="600px"></iframe></td>
</tr>
</table>
</body>
</html>

Copy after login

The run2.php file is as follows:

<&#63;php
 $code = stripslashes($_POST['php_code']);
 if(!strstr($code,'<&#63;php'))
  $code = '<&#63;php'.PHP_EOL.$code ;
 file_put_contents('run3.php',$code);
 header("Location:./run3.php");

Copy after login

Click here to download the complete example code from this website.

Readers who are interested in more PHP-related content can check out the special topics of this site: "Summary of PHP Regular Expression Usage", "Summary of PHP Ajax Skills and Applications", "Summary of PHP Operations and Operator Usage", "PHP Network Summary of Programming Skills", "Introduction Tutorial on PHP Basic Syntax", "Summary of PHP Office Document Operation Skills (Including Word, Excel, Access, PPT)", "Summary of PHP Date and Time Usage", "Introduction Tutorial on PHP Object-Oriented Programming" , "php string (string) usage summary", "php mysql database operation introductory tutorial" and "php common database operation skills summary"

I hope this article will be helpful to everyone in PHP programming.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1123825.htmlTechArticle Implementation method of PHP online debugging execution (with demo source code attached), demo source code This article describes the implementation of PHP online execution method. Share it with everyone for your reference, the details are as follows: Screenshot of the operation effect...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template