<HTML>pouzij moji tridu co jsem kdysi vytvoril, na konci je ukazka tam je vse ujasneno:
class File_System {
var $filename = "";
var $filemod = "a";
var $string = '';
var $tmp_name = "no.tmp";
function secure($xstring)
{
$xstring = htmlspecialchars($xstring);
$xstring = str_replace("\n", "<br>", $xstring);
$xstring = str_replace("\r", "", $xstring);
$xstring = str_replace("|", "-", $xstring);
$xstring = trim($xstring);
return $xstring;
}
function s_num_rows()
{
if (!@file_exists($this->filename))
fopen($this->filename, "w");
return count(file($this->filename));
}
function s_save()
{
$arg = func_get_args();
$indexs = func_num_args();
$this->string = $this->s_num_rows()."|";
for($i = 0; $i < $indexs; $i++) {
$this->string .= $this->secure($arg[$i]);
if ($i < $indexs-1)
$this->string .= "|";
}
while(file_exists($this->tmp_name));
fclose(fopen($this->tmp_name, "w"));
$fp = fopen($this->filename, $this->filemod);
$this->string .= "\n";
fwrite($fp, $this->string);
fflush($fp);
fclose($fp);
unlink($this->tmp_name);
}
function s_load($rowid = -1)
{
static $pointer = 0;
if (!@file_exists($this->filename))
fopen($this->filename, "w");
$row = file($this->filename);
$row = array_reverse($row);
if ($pointer >= count($row)) {
return 0;
}
if ($rowid > -1) {
$arg = explode("|", $row[$rowid]);
}
else {
$arg = explode("|", $row[$pointer]);
$pointer++;
}
return $arg;
}
}
/* Example:
$FS = new File_System;
// Save into file
$datum = time();
$name = "Projector";
$email = "max.p@maildomain.cz";
$text = "Project down";
$FS->s_save($datum, $name, $email, $text); // unlimited arguments
// Read from file
while ($row = $FS->s_load()) {
echo "$row[0] - $row[1] - $row[2] - $row[3] ...";
}
// or: $row = $FS->s_load(5); - read only row with index 5
*/</HTML>
ja som jednu vytvoril
tu je skript:
<-----index.php------>
<head>
<title>Kniha náv?tev</title>
<script language="javascript">
<!--
function checkform()
{
var retval
retval = true
if (document.all["meno"].value == "")
{
alert("Nevyplnil si meno!");
document.all["meno"].focus();
retval = false;
}
if (document.all["body"].value == "")
{
alert("Nevyplnil si odkaz!");
document.all["body"].focus();
retval = false;
}
return retval;
}
-->
</script>
<style type="text/css">
<!--
a { text-decoration: none }
a:hover { color: #cc0000; text-decoration: underline }
body
{
scrollbar-face-color: #2CA9F3;
scrollbar-shadow-color: blue;
scrollbar-highlight-color: blue;
scrollbar-3dlight-color: blue;
scrollbar-darkshadow-color: blue;
scrollbar-track-color: #666699;
scrollbar-arrow-color: blue
}
//-->
</style>
</head>
<body bgcolor="#2CA9F3">
<blockquote><blockquote><blockquote><blockquote>
<?php
$subor="text.html";
include $subor;
?>
</blockquote></blockquote></blockquote></blockquote>
<hr color="black" size="10">
<script LANGUAGE="JavaScript">
<!-----
function InsSm(sm)
{
document.form1.body.focus();
document.form1.body.value=document.form1.body.value+sm;
}
//---->
</script>
<form name="form1" action="zdts.php" method="post" onsubmit="return checkform();">
<input type="Hidden" name="t" value="3">
<input type="Hidden" name="a" value="post">
<input type="Hidden" name="f" value="2">
<input type="Hidden" name="p" value="5">
<input type="hidden" name="lng" value="svk">
Tvoje meno:<br>
<input type="text" name="meno" size="30"><br>
Tvoj e-mail:<br>
<input type="text" name="email" size="30"><br>
Http://:<br>
<input type="text" name="http" size="30"><br>
<tr>
<td height="23" nowrap>
</td>
<td height="23" nowrap>
<center><img src="1.gif" border=0 onclick="javascript:void InsSm('1 ')">
<img src="2.gif" border=0 onclick="javascript:void InsSm('2 ')">
<img src="3.gif" border=0 onclick="javascript:void InsSm('3 ')">
<img src="4.gif" border=0 onclick="javascript:void InsSm('4 ')">
<img src="5.gif" border=0 onclick="javascript:void InsSm('5 ')">
<img src="6.gif" border=0 onclick="javascript:void InsSm('6 ')">
<img src="7.gif" border=0 onclick="javascript:void InsSm('7 ')">
<img src="8.gif" border=0 onclick="javascript:void InsSm('8 ')">
<img src="9.gif" border=0 onclick="javascript:void InsSm('9 ')">
<img src="10.gif" border=0 onclick="javascript:void InsSm('10 ')">
<img src="11.gif" border=0 onclick="javascript:void InsSm('11 ')">
<img src="12.gif" border=0 onclick="javascript:void InsSm('12 ')">
<img src="13.gif" border=0 onclick="javascript:void InsSm('13 ')">
<img src="14.gif" border=0 onclick="javascript:void InsSm('14 ')">
<img src="15.gif" border=0 onclick="javascript:void InsSm('15 ')">
<img src="16.gif" border=0 onclick="javascript:void InsSm('16 ')">
<img src="17.gif" border=0 onclick="javascript:void InsSm('17 ')">
<img src="18.gif" border=0 onclick="javascript:void InsSm('18 ')">
<img src="19.gif" border=0 onclick="javascript:void InsSm('19 ')">
<img src="20.gif" border=0 onclick="javascript:void InsSm('20 ')">
<img src="21.gif" border=0 onclick="javascript:void InsSm('21 ')">
<img src="22.gif" border=0 onclick="javascript:void InsSm('22 ')">
<img src="23.gif" border=0 onclick="javascript:void InsSm('23 ')">
<img src="24.gif" border=0 onclick="javascript:void InsSm('24 ')">
<img src="25.gif" border=0 onclick="javascript:void InsSm('25 ')">
<img src="26.gif" border=0 onclick="javascript:void InsSm('26 ')">
<img src="27.gif" border=0 onclick="javascript:void InsSm('27 ')">
<img src="28.gif" border=0 onclick="javascript:void InsSm('28 ')">
<img src="29.gif" border=0 onclick="javascript:void InsSm('29 ')">
<img src="30.gif" border=0 onclick="javascript:void InsSm('30 ')">
<img src="31.gif" border=0 onclick="javascript:void InsSm('31 ')">
<img src="32.gif" border=0 onclick="javascript:void InsSm('32 ')">
<img src="33.gif" border=0 onclick="javascript:void InsSm('33 ')">
<img src="34.gif" border=0 onclick="javascript:void InsSm('34 ')">
<img src="35.gif" border=0 onclick="javascript:void InsSm('35 ')"></center>
</td>
</tr>
<tr>
<td colspan=2 nowrap align="left">
<table cellpadding="5" cellspacing="0" border="0">
<tr>
<td align="CENTER" valign="TOP">
Miesto pre tvoj odkaz:<br>
<font face="courier"><textarea name="body" cols="40" rows="5" ></textarea></font>
</td>
</tr>
</table>
</td>
</tr>
<input type="submit" value="Odosla?" name="action"> <input type="reset" value="Vyma?">
</form>
Copiright© by Timton®
<body>
musis si tam dohodit smajlikov asi 35 menuj ich od 1.gif do 35.gif
<------zdts.php------>
<head>
<title>Kniha náv?tev</title>
</head>
<body bgcolor="#2CA9F3">
<?php
if ($email == ""){
$m = "<b><font color=\"red\">Tvoje meno: </font></b>" . $meno;
$h = "                <b><font color=red><a href=http://$http>$http</a></font></b>" . "<br>";
$html = Htmlspecialchars($HTTP_POST_VARS["body"]);
$stra = array("1" => "<img src=1.gif>", "2" => "<img src=2.gif>", "3" => "<img src=3.gif>", "4" => "<img src=4.gif>", "5" => "<img src=5.gif>", "6" => "<img src=6.gif>", "7" => "<img src=7.gif>", "8" => "<img src=8.gif>", "9" => "<img src=9.gif>", "10" => "<img src=10.gif>", "11" => "<img src=11.gif>", "12" => "<img src=12.gif>", "13" => "<img src=13.gif>", "14" => "<img src=14.gif>", "15" => "<img src=15.gif>", "16" => "<img src=16.gif>", "17" => "<img src=17.gif>", "18" => "<img src=18.gif>", "19" => "<img src=19.gif>", "20" => "<img src=20.gif>", "21" => "<img src=21.gif>", "22" => "<img src=22.gif>", "23" => "<img src=23.gif>", "24" => "<img src=24.gif>", "25" => "<img src=25.gif>", "26" => "<img src=26.gif>", "27" => "<img src=27.gif>", "28" => "<img src=28.gif>", "29" => "<img src=29.gif>", "30" => "<img src=30.gif>", "31" => "<img src=31.gif>", "32" => "<img src=32.gif>", "33" => "<img src=33.gif>", "34" => "<img src=34.gif>", "35" => "<img src=35.gif>");
$str = strtr($html, $stra);
$t = "<b><font color=\"red\">Odkaz: </font></b>" . $str . "<br>";
$datum = date("d.m.Y");
$cas = date("G:i:s");
$dat = "<font size=1>Tento príspevok bol pridaný   $datum   o   $cas </font>" . "<br><hr>";
$mht = $m . $h . $t . $dat;
$fn = FOpen("text.html" , "a");
FWrite($fn , $mht);
FClose($fn);
} elseif ($http == ""){
$m2 = $meno . "<br>";
$m = "<b><font color=\"red\">Tvoje meno: </font></b>" . $m2;
$e2 = "<a href=mailto:$email>$email</a>" . "<br>";
$e = "<b><font color=\"red\">Tvoj e-mail: </font></b>" . $e2;
$html = Htmlspecialchars($HTTP_POST_VARS["body"]);
$stra = array("1" => "<img src=1.gif>", "2" => "<img src=2.gif>", "3" => "<img src=3.gif>", "4" => "<img src=4.gif>", "5" => "<img src=5.gif>", "6" => "<img src=6.gif>", "7" => "<img src=7.gif>", "8" => "<img src=8.gif>", "9" => "<img src=9.gif>", "10" => "<img src=10.gif>", "11" => "<img src=11.gif>", "12" => "<img src=12.gif>", "13" => "<img src=13.gif>", "14" => "<img src=14.gif>", "15" => "<img src=15.gif>", "16" => "<img src=16.gif>", "17" => "<img src=17.gif>", "18" => "<img src=18.gif>", "19" => "<img src=19.gif>", "20" => "<img src=20.gif>", "21" => "<img src=21.gif>", "22" => "<img src=22.gif>", "23" => "<img src=23.gif>", "24" => "<img src=24.gif>", "25" => "<img src=25.gif>", "26" => "<img src=26.gif>", "27" => "<img src=27.gif>", "28" => "<img src=28.gif>", "29" => "<img src=29.gif>", "30" => "<img src=30.gif>", "31" => "<img src=31.gif>", "32" => "<img src=32.gif>", "33" => "<img src=33.gif>", "34" => "<img src=34.gif>", "35" => "<img src=35.gif>");
$str = strtr($html, $stra);
$t = "<b><font color=\"red\">Odkaz: </font></b>" . $str . "<br>";
$datum = date("d.m.Y");
$cas = date("G:i:s");
$dat = "<font size=1>Tento príspevok bol pridaný   $datum   o   $cas </font>" . "<br><hr>";
$met = $m . $e . $t . $dat;
$fn = FOpen("text.html" , "a");
FWrite($fn , $met);
FClose($fn);
} elseif ($meno && $http && $email && $body){
$m = "<b><font color=\"red\">Tvoje meno: </font></b>" . $meno;
$h2 = " <br>";
$h = "                <b><font color=\"red\"><a href=http://$http>$http</a></font></b>" . $h2;
$e2 = "<a href=mailto:$email>$email</a>" . "<br>";
$e = "<b><font color=\"red\">Tvoj e-mail: </font></b>" . $e2;
$html = Htmlspecialchars($HTTP_POST_VARS["body"]);
$stra = array("1" => "<img src=1.gif>", "2" => "<img src=2.gif>", "3" => "<img src=3.gif>", "4" => "<img src=4.gif>", "5" => "<img src=5.gif>", "6" => "<img src=6.gif>", "7" => "<img src=7.gif>", "8" => "<img src=8.gif>", "9" => "<img src=9.gif>", "10" => "<img src=10.gif>", "11" => "<img src=11.gif>", "12" => "<img src=12.gif>", "13" => "<img src=13.gif>", "14" => "<img src=14.gif>", "15" => "<img src=15.gif>", "16" => "<img src=16.gif>", "17" => "<img src=17.gif>", "18" => "<img src=18.gif>", "19" => "<img src=19.gif>", "20" => "<img src=20.gif>", "21" => "<img src=21.gif>", "22" => "<img src=22.gif>", "23" => "<img src=23.gif>", "24" => "<img src=24.gif>", "25" => "<img src=25.gif>", "26" => "<img src=26.gif>", "27" => "<img src=27.gif>", "28" => "<img src=28.gif>", "29" => "<img src=29.gif>", "30" => "<img src=30.gif>", "31" => "<img src=31.gif>", "32" => "<img src=32.gif>", "33" => "<img src=33.gif>", "34" => "<img src=34.gif>", "35" => "<img src=35.gif>");
$str = strtr($html, $stra);
$t = "<b><font color=\"red\">Odkaz: </font></b>" . $str . "<br>";
$datum = date("d.m.Y");
$cas = date("G:i:s");
$dat = "<font size=1>Tento príspevok bol pridaný   $datum   o   $cas </font>" . "<br><hr>";
$meht = $m . $h . $e . $t . $dat;
$fn = FOpen("text.html" , "a");
FWrite($fn , $meht);
FClose($fn);
}
?>
<a href="index.php">Obnovit</a> <br>
<?php $ahoj = "Ahoj " ;
$ahoj2 = $ahoj . $meno ;
echo $ahoj2 ;
?>
.  Sme radi ?e si pridal odkaz do na?ej Knihy náv?tev.
tato kniha je jednoduch je to len zapis do sudoru
Pozeram ze tu trosku blbnu znaky tak si to oprav
Tato kniha je na stranke timton.wz.cz
Ak chces poslem ti smajlikov