<textarea cols='100' rows='100' name='text'><?php include("file.html");</textarea>
Дефакто, при теб ще е :<textarea cols='100' rows='100' name='text'><?php include("file.html");</textarea>
Като минеш въведеното съдържание през:<textarea cols='100' rows='100' name='text'></textarea>
(примерно!!!)htmlspecialchars(addslashes($_POST['text'))
<?php
include("connect.php"); {
$file = $_SERVER['HTTP_REFERER'];
$file1 = end(explode("./", $file));
$cont = file_get_contents($file);
echo "<div align='center'>Промяна на (<b>$file</b>)</div><br><form action='apedit.php' method='post'>
<input type='hidden' name='file' value='$file1'>
<div align='center'>
<textarea cols='100' rows='100' name='text'>htmlspecialchars(addslashes($_POST['$cont'))</textarea></div>
<br><div align='center'><input type='submit' value='Промени' class='edw'></form></div>";
}
?>
<?
include("style1.html");
?>
<table style="border:1px dashed; color:#666666" cellpadding="5" cellspacing="0" width="100%">
<tr><td align="center" height="30" style="background:url('images/back.gif') #808080;color:#FFFFFF;padding-bottom:5px;font-size:10px;"><b>Начало</b></td></tr></table><table style="border:1px dashed; color:#666666; padding: 10px; background:url('images/backgr.jpg'); -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" cellpadding="5" cellspacing="0" width="100%"><tr><td><br><font color="#FFFFFF"><div align="center">Добре дошли в официалния сайт на системата <b>wSys</b> от <u>WildBeast</u> .</div></font><br /></td></tr></table>
<?
include("style2.html");
?>
primer.php<?php
/**
* @author adminite
* @copyright 2009
*/
$filename = "primer.php";
$handle = fopen($filename, "rb");
$contents = fread($handle, filesize($filename));
?>
<textarea cols="20" rows="10"><?php echo $contents ?></textarea>
и в текстареата ще излезе<?php
/**
* @author adminite
* @copyright 2009
*/
echo '123';
?>
<?php
/**
* @author adminite
* @copyright 2009
*/
echo '123';
?>
Warning: filesize() [function.filesize]: stat failed for http://cstrikebg.comuv.com/index.html in /home/a1562766/public_html/apedit1.php on line 12
Warning: fread() [function.fread]: Length parameter must be greater than 0 in /home/a1562766/public_html/apedit1.php on line 12
<?php
include("connect.php"); {
$file = ("index.html");
$file1 = end(explode("/", $file));
$cont = file_get_contents($file);
echo "<div align='center'>Промяна на (<b>$file</b>)</div><br><form action='apedit.php' method='post'>
<input type='hidden' name='file' value='$file1'>
<div align='center'>
<textarea cols='100' rows='100' name='text'>$cont</textarea></div>
<br><div align='center'><input type='submit' value='Промени' class='edw'></form></div>";
}
?>
<textarea cols='100' rows='100' name='text'><?php echo htmlspecialchars("<?php include(\"file.html\"); ?>"); ?></textarea>
<?
include("style1.html");
?>
<table style="border:1px dashed; color:#666666" cellpadding="5" cellspacing="0" width="100%">
<tr><td align="center" height="30" style="background:url('images/back.gif') #808080;color:#FFFFFF;padding-bottom:5px;font-size:10px;"><b>За контакти</b></td></tr></table><table style="border:1px dashed; color:#666666; padding: 10px; background:url('images/backgr.jpg'); -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" cellpadding="5" cellspacing="0" width="100%"><tr><td><br><? include("contact.php"); ?><br /></td></tr></table>
<?
include("style2.html");
?>
Ще стане<?php
/**
* @author adminite
* @copyright 2009
*/
$file = $_GET['file'];
$filename = "primer.php";
$handle = fopen($filename, "rb");
$contents = fread($handle, filesize($filename));
?>
<textarea cols="20" rows="10"><?php echo $contents ?></textarea>
Така ,ако си бил в site.com/site.php и като натиснеш промени страницата ще ти покаже кода от site.php,но ако напишеш apedit1.php?file=lqlq.php в ареата ще се покаже кода на lqlq.php<?php
/**
* @author adminite
* @copyright 2009
*/
if(isset($_GET['file'])) {
$filename = $_GET['file'];
}
if(!isset($_GET['file'])) {
$my = "localhost/isite/primeri.php";
echo $my;
$ex = explode("/",$my);
if($ex[0] != "http:") {
$filename = $ex[2];
echo $filename;
}
else{
$filename = $ex[4];
}
$handle = fopen($filename, "r");
$contents = fread($handle, filesize($filename));
}
?>
<textarea cols="20" rows="10"><?php echo $contents ?></textarea>
<?php
/**
* @author adminite
* @copyright 2009
*/
if(isset($_GET['file'])) {
$filename = $_GET['file'];
}
if(!isset($_GET['file'])) {
$my = "localhost/isite/primeri.php";
echo $my;
$ex = explode("/",$my);
if($ex[0] != "http:") {
$filename = $ex[2];
echo $filename;
}
else{
$filename = $ex[4];
}
$contents = file_get_contents($filename);
}
?>
<textarea cols="20" rows="10"><?php echo $contents ?></textarea>
<a href="apedit.php?file=<?=basename(__FILE__)?>">[Редактирай страницата]</a>