<? /******************************.
/ *PhpView* - 0.1 - 10 dec 1999 |
| written by mose <php@mose.com> |
| Just put that file anywhere |
| in an unix apache+php webtree |
| Call it with your browser |
| you'll save time in debugging. |
| ------------------------------ |
| That piece of code is free |
'------------------------------*/ ?>
<? if (empty($pvfile)) { $pvfile = "/tmp/test.".time().".php"; } ?>
<? if ($pvin == "top") { ?>
<html><body bgcolor=#ffffff>
<form action=<? echo $PHP_SELF; ?> method=post target=content>
<input type=hidden name=pvin value=content>
<input type=hidden name=pvfile value="<? echo $pvfile; ?>">
<textarea name=pvtext cols=80 rows=12 wrap=no><? echo "$pvtext"; ?></textarea>
<input type=submit name=pvaction value='View'>
</form></body></html>
<? } elseif ($pvin == "content") {
if (!empty($pvtext)) {
$pvfp = fopen($pvfile,"w");
fputs($pvfp,"$pvtext");
fclose($pvfp);
echo "Result ($pvfile)";
echo "<hr noshade size=1>\n";
if (is_file($pvfile)) {
$pvtimein = split(" ",microtime());
include "$pvfile";
$pvtimeout = split(" ",microtime());
echo "<hr noshade size=1>\n";
$pvlapsm = $pvtimeout[0] - $pvtimein[0];
$pvlapss = $pvtimeout[1] - $pvtimein[1];
echo "TimeSpent ".$pvlapss+$pvlapsm;
}
} else {
echo "Type in the box your php or html text, it will be included in the bottom
frame.<br>";
echo "<b>PhpView</b> also displays time spent to do it.";
}
} else { ?>
<html>
<head><title>PhpView</title></head>
<frameset rows="230,*">
<frame name=top src=<? echo $PHP_SELF; ?>?pvin=top frameborder=0 framespacing=0>
<frame name=content src=<? echo $PHP_SELF; ?>?pvin=content frameborder=0 framespacing=0>
</frameset>
</html>
<? } ?>