Run HTML and JavaScript by PHP

Written by @m_k_amin 26 December 2012

This is a short script shows how can you make a text and let the user to type and try their own HTML and JavaScript codes.

Code Snippet:

                                                
                                                <!-- this script is provided by www.phpfreecode.com coded by: Kerixa Inc. -->
<!-- This Script is from www.phpfreecpde.com, Coded by: Kerixa Inc-->
<form method="post" action="">
<table style="border: 1px solid #000000;width: 596px" align="center">
	<tr>
		<td style="padding:5px;font-family: 'Times New Roman', Times, serif;font-size: 17pt;text-align: center;color: #2214B9;border-style: solid;border-width: 1px; height: 244px;"><table style="width: 100%">
			<tr>
				<td style="width: 438px; text-align: center">
				<textarea name="code" style="width: 443px; color: #000000; height: 248px; background-color: #F4F8D1; font-family: 'times New Roman', Times, serif; font-size: 12pt;" cols="20" rows="1"><?php if (isset($_POST['Run'])) echo $_POST['code'];?>
</textarea></td>
				<td style="text-align: center">
		<input name="Run" style="width: 88px; height: 49px; font-size: 24pt; font-family: 'Times New Roman', Times, serif; color: #19B024;" type="submit" value="Run"></td>
			</tr>
		</table>
		</td>
	</tr>
	<tr>
		<td style=" padding:5px; border-style: solid;border-width: 1px;text-align: left; height: 39px; font-size: 14pt; background-color: #D3ECA8;">
		<span style="font-family: 'Times New Roman', Times, serif; color: #7B0909">
		Result:</span><br>
<?php
if (isset($_POST['Run']))
	echo $_POST['code'];
?>		
		</td>
	</tr>
</table>


<div style="text-align: center">
	<br>
<font face="Tahoma">
<span style="font-size: 8pt; text-decoration: none"><a target="_blank" href="http://www.phpfreecode.com/">
	PHP Free Code</a></span></font>
</div>
</form><a target='_blank' href='www.phpfreecode.com' style='font-size: 8pt; text-decoration: none'>Php Best Codes</a>                                                
                                            

Example:


About @m_k_amin

This user is pending a biography.

M

Comments


Here you can leave us commments. Let us know what you think about this code tutorial!

0 / 300

TRENDING POST
1
2
3
4
5
VISITORS
Online Users: 12
Recent Members: grkkid, Manaakividuinfo.com, karticksv, sava, tinatina
advertisement 2