Jednoduchá kniha návštěv bez SQL (5) -
zdrojový kód
<style>
BODY
{
scrollbar-face-color: #008000;
scrollbar-shadow-color:#008000;
scrollbar-highlight-color:#008000;
scrollbar-3dlight-color: #CCFF99;
scrollbar-darkshadow-color:#CCFF99;
scrollbar-track-color:#CCFF99;
scrollbar-arrow-color:#008000;
}
A, A:Visited {
color: 008000;
text-decoration: underline;
}
A:Active, A:Hover {
color: 008000;
text-decoration: none;
}
</style>
<html>
<head>
<title></title>
<link rel=StyleSheet href="/s.css" type="text/css">
</head>
<body background="../usmev.jpg" bgproperties="fixed"> <div align="center"> </center>
<div align="center"><table width="500" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<form method="post" action="board.php" name="f">
<table border=0 width=10% cellspacing=0 cellpadding=0>
<tr>
<td> <b> <font color="#008000"><font face="Verdana" size="2">
Jméno:
</td>
<td>
<input type="text" name="meno" size="53">
</td>
</tr>
<tr>
<td><b> <font color="#008000"><font face="Verdana" size="2">
email:
</td>
<td>
<input type="text" name="mail" size="53" value="@">
</td>
</tr>
<tr>
<td> <b> <font color="#008000"><font face="Verdana" size="2">
http:
</td>
<td>
<input type="text" name="web" size="53">
</td>
</tr>
<tr>
<td colspan=2> <b> <font color="#008000"><font face="Verdana" size="2">
text: <textarea name="text" cols="40" rows="3" wrap=virtual>
</textarea>
</td>
</tr>
<tr>
<td colspan=2 align=center>
<input type="submit" value="Submit">
</td>
</tr>
</table>
</form>
</td></tr>
<tr><td> <font size="2"><font color="008000">
<script type="text/javascript">
function Smile(what)
{
document.forms.f.text.focus();
document.forms.f.text.value=document.forms.f.text.value+what;
}
</script>
<b>Smajlíci:
<img onclick="Smile('**01 ')" src="http://www.litmladez.unas.cz/board/usmev.gif">
<img onclick="Smile('**02 ')" src="http://www.litmladez.unas.cz/board/mraceni.gif">
<img onclick="Smile('**03 ')" src="http://www.litmladez.unas.cz/board/smrtka.gif">
<img onclick="Smile('**04 ')" src="http://www.litmladez.unas.cz/board/otrava.gif">
<img onclick="Smile('**05 ')" src="http://www.litmladez.unas.cz/board/hrozeni.gif">
<img onclick="Smile('**06 ')" src="http://www.litmladez.unas.cz/board/upir.gif">
<img onclick="Smile('**07 ')" src="http://www.litmladez.unas.cz/board/zivani.gif">
<img onclick="Smile('**08 ')" src="http://www.litmladez.unas.cz/board/plac.gif">
<img onclick="Smile('**09 ')" src="http://www.litmladez.unas.cz/board/koukani.gif">
<img onclick="Smile('**10 ')" src="http://www.litmladez.unas.cz/board/cas.gif">
<img onclick="Smile('**11 ')" src="http://www.litmladez.unas.cz/board/zarovka.gif">
<img onclick="Smile('**12 ')" src="http://www.litmladez.unas.cz/board/bezzubec.gif">
<img onclick="Smile('**13 ')" src="http://www.litmladez.unas.cz/board/oko.gif">
<img onclick="Smile('**14 ')" src="http://www.litmladez.unas.cz/board/telefon.gif">
<img onclick="Smile('**15 ')" src="http://www.litmladez.unas.cz/board/mavani.gif">
<img onclick="Smile('**16 ')" src="http://www.litmladez.unas.cz/board/toaletak.gif">
</center>
</font></b>
<?
//zde se ptame, zda byla odeslana pomoci formulare promenna $text
if(isset($text)):
/* a zde jiz nahrazujeme urcitz smajlik nasim obrazkem umistenym ve stejne
slozce jako nas skript*/
$text = str_replace("**01", "<IMG SRC=\"http://www.litmladez.unas.cz/board/usmev.gif\" alt=\"\">", $text);
$text = str_replace("**02", "<IMG SRC=\"http://www.litmladez.unas.cz/board/mraceni.gif\" alt=\"\">", $text);
$text = str_replace("**03", "<IMG SRC=\"http://www.litmladez.unas.cz/board/smrtka.gif\" alt=\"\">", $text);
$text = str_replace("**04", "<IMG SRC=\"http://www.litmladez.unas.cz/board/otrava.gif\" alt=\"\">", $text);
$text = str_replace("**05", "<IMG SRC=\"http://www.litmladez.unas.cz/board/hrozeni.gif\" alt=\"\">", $text);
$text = str_replace("**06", "<IMG SRC=\"http://www.litmladez.unas.cz/board/upir.gif\" alt=\"\">", $text);
$text = str_replace("**07", "<IMG SRC=\"http://www.litmladez.unas.cz/board/zivani.gif\" alt=\"\">", $text);
$text = str_replace("**08", "<IMG SRC=\"http://www.litmladez.unas.cz/board/plac.gif\" alt=\"\">", $text);
$text = str_replace("**09", "<IMG SRC=\"http://www.litmladez.unas.cz/board/koukani.gif\" alt=\"\">", $text);
$text = str_replace("**10", "<IMG SRC=\"http://www.litmladez.unas.cz/board/cas.gif\" alt=\"\">", $text);
$text = str_replace("**11", "<IMG SRC=\"http://www.litmladez.unas.cz/board/zarovka.gif\" alt=\"\">", $text);
$text = str_replace("**12", "<IMG SRC=\"http://www.litmladez.unas.cz/board/bezzubec.gif\" alt=\"\">", $text);
$text = str_replace("**13", "<IMG SRC=\"http://www.litmladez.unas.cz/board/oko.gif\" alt=\"\">", $text);
$text = str_replace("**14", "<IMG SRC=\"http://www.litmladez.unas.cz/board/telefon.gif\" alt=\"\">", $text);
$text = str_replace("**15", "<IMG SRC=\"http://www.litmladez.unas.cz/board/mavani.gif\" alt=\"\">", $text);
$text = str_replace("**16", "<IMG SRC=\"http://www.litmladez.unas.cz/board/toaletak.gif\" alt=\"\">", $text);
endif;
//no a zde jiz vypiseme promennou - obrazek
if (($meno=="") and ($mail=="") and ($odkaz!=""))
{
}
if (($meno!="") or ($mail!=""))
{
$meno=strip_tags($meno); $mail=strip_tags($mail); $web=strip_tags($web);
$odkaz=strip_tags($odkaz,"<|>,<>,<*>"); $odkaz=nl2br($odkaz);
}
if (($mail!="") and ($meno!="")) {$mail="<a href=mailto:$mail>$meno</a>";}
else {$mail=""; }
if ($web!="") {$web="|<a href=http://$web>$web</a>";}
else {$web="";}
if (($meno!="") or ($mail!=""))
{
$old = @fread(@fopen("board.txt","r"),@filesize("board.txt"));
//nastavit formatovanie odkazov
$new = "<hr color=008000> <b><font face=Verdana size=2> $mail</b></font><small> <font face=Verdana size=1> $web ".date("d.n.Y H:i:s")." </small> <br></font> <font face=Times New Roman size=2><br> $text";
$old = $new.$old;
$f = fopen("board.txt","w");
fputs($f,$old);
fclose($f);
}
include("board.txt");
?>
</td></tr>
</table>
</body>
</html>
Vložil/Poslal/Autor: Admin
Funkčnost:
běží na straně serveru, nemělo by záležet na typu prohlížeče