PHP - Обикновена книга за гости 2 - не изисква mySQL
Това е новата книга за гости има доста нови подобрения.
Скрипра който се използва е много прост, в което ще се убедите сами.Има и администраторска част, която може да модерирате както искате.

Изтегли Книгата за гости

Ето два скрийна от книгата за гости. А ето тук можете да тествате книгата за гости.





За да смените паролата на вашия контрол панел трябва да отворите файл admin.php и на този ред да
промените вашия потребителско име и вашата парола.
if ($potrebitel!='потребителско име' || $pas!='парола')

Структура:


db.php
index.php
kniga-save.php
populni-kniga.html

admin
/admin/index.php
/admin/del.php
/admin/post.php
/admin/edit.php
/admin/index.html
/admin/smilies/biggrin.gif
/admin/smilies/cool.gif
/admin/smilies/cry.gif
/admin/smilies/dead.gif
/admin/smilies/eek.gif
/admin/smilies/embarrassed.gif
/admin/smilies/laugh.gif
/admin/smilies/love.gif
/admin/smilies/mad.gif
/admin/smilies/no.gif
/admin/smilies/none.gif
/admin/smilies/rolleyes.gif
/admin/smilies/sad.gif
/admin/smilies/smile.gif
/admin/smilies/smilewinkgrin.gif
/admin/smilies/upset.gif
/admin/smilies/wink.gif
/admin/smilies/yes.gif

posts
/posts/1.html и т.н. .....

files
/files/baners.swf
/files/font.css
/files/script.js

smilies
/smilies/biggrin.gif
/smilies/cool.gif
/smilies/cry.gif
/smilies/dead.gif
/smilies/eek.gif
/smilies/embarrassed.gif
/smilies/laugh.gif
/smilies/love.gif
/smilies/mad.gif
/smilies/no.gif
/smilies/none.gif
/smilies/rolleyes.gif
/smilies/sad.gif
/smilies/smile.gif
/smilies/smilewinkgrin.gif
/smilies/upset.gif
/smilies/wink.gif
/smilies/yes.gif



db.php
<?php $broi=1 ; ?>



index.php
<?php
include "db.php";
?>
<html>
<head><link rel="stylesheet" href="files/font.css" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<title>Книга за гости !</title></head>
<body><center><OBJECT CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
WIDTH="300" HEIGHT="100"
CODEBASE="http://active.macromedia.com/flash5/cabs/swflash.cab#version=5,0,0,0">
<PARAM NAME="MOVIE" VALUE="files/baners.swf">
<PARAM NAME="PLAY" VALUE="true">
<PARAM NAME="LOOP" VALUE="true">
<PARAM NAME="WMODE" VALUE="opaque">
<PARAM NAME="QUALITY" VALUE="high">
<EMBED SRC="files/baners.swf" WIDTH="300" HEIGHT="100" PLAY="true" LOOP="true" WMODE="opaque" QUALITY="high"
PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">
</EMBED>
</OBJECT></center><br>
<table width="590" align="center">
<tr>
<td>
<?php
for ($i=$broi; $i>$broi-11;$i--){
if (is_file("posts/".$i.".html")) {
include "posts/".$i.".html";
echo "<BR>";

}
}
?>
</td>
</tr>
</table>
<table><tr><td></td><td width="100%" align="right"><a href="admin/index.html"><font size="1">Контрол Панел</font></a></td></tr></table>
</table>
</body>
</html>



kniga-save.php

<?php
umask(0);
if ( isset($_POST['име']) AND isset($_POST['майл']) AND isset($_POST['уеб']) AND isset($_POST['град']) AND isset($_POST['мсг']) ) {
$user = $_POST['име'];
$mail = $_POST['майл'];
$http = $_POST['уеб'];
$town = $_POST['град'];
$msg = $_POST['мсг'];

if (( $user != "" ) AND ( $msg != "" )) {
include "db.php";
$ip = $_SERVER['REMOTE_ADDR'];
$vreme=date("d F Y, H:i");

$http=str_replace("<",'<',$http);
$http=str_replace(">",'>',$http);
$town=str_replace("<",'<',$town);
$town=str_replace(">",'>',$town);
$user=str_replace("<",'<',$user);
$user=str_replace(">",'>',$user);
$mail=str_replace("<",'<',$mail);
$mail=str_replace(">",'>',$mail);
$msg=str_replace("<",'<',$msg);
$msg=str_replace(">",'>',$msg);
$msg=preg_replace("/(\[b\])(.+?)(\[\/b\])/i", "<b>\\2</b>", $msg);
$msg=preg_replace("/(\[i\])(.+?)(\[\/i\])/i", "<i>\\2</i>", $msg);
$msg=preg_replace("/(\[u\])(.+?)(\[\/u\])/i", "<u>\\2</u>", $msg);
$msg=preg_replace("/(\[email=(.+?)\])(.+?)(\[\/email\])/i", '<a href="mailto:\\2" target="_blank">\\3</a>',$msg);
$msg=preg_replace("/(\[email\])(.+?)(\[\/email\])/i", '<a href="mailto:\\2">\\2</a>', $msg);
$msg=preg_replace("/(\[url\])(.+?)(\[\/url\])/i", '<a href="\\2" target="_blank">\\2</a>', $msg);
$msg=preg_replace("/(\[url=\])(.+?)(\[\/url\])/i", '<a href="\\2" target="_blank">\\2</a>', $msg);
$msg=preg_replace("/(\[url=(.+?)\])(.+?)(\[\/url\])/i", '<a href="\\2" target="_blank">\\3</a>', $msg);
$msg=str_replace(":biggrin:",'<img src=smilies/biggrin.gif>',$msg);
$msg=str_replace(":cool:",'<img src=smilies/cool.gif>',$msg);
$msg=str_replace(":cry:",'<img src=smilies/cry.gif>',$msg);
$msg=str_replace(":dead:",'<img src=smilies/dead.gif>',$msg);
$msg=str_replace(":eek:",'<img src=smilies/eek.gif>',$msg);
$msg=str_replace(":embarrassed:",'<img src=smilies/embarrassed.gif>',$msg);
$msg=str_replace(":laugh:",'<img src=smilies/laugh.gif>',$msg);
$msg=str_replace(":love:",'<img src=smilies/love.gif>',$msg);
$msg=str_replace(":mad:",'<img src=smilies/mad.gif>',$msg);
$msg=str_replace(":no:",'<img src=smilies/no.gif>',$msg);
$msg=str_replace(":none:",'<img src=smilies/none.gif>',$msg);
$msg=str_replace(":rolleyes:",'<img src=smilies/rolleyes.gif>',$msg);
$msg=str_replace(":sad:",'<img src=smilies/sad.gif>',$msg);
$msg=str_replace(":smile:",'<img src=smilies/smile.gif>',$msg);
$msg=str_replace(":smilewinkgrin:",'<img src=smilies/smilewinkgrin.gif>',$msg);
$msg=str_replace(":upset:",'<img src=smilies/upset.gif>',$msg);
$msg=str_replace(":wink:",'<img src=smilies/wink.gif>',$msg);
$msg=str_replace(":yes:",'<img src=smilies/yes.gif>',$msg);
$write1 = "<table class='b' cellspacing=0 cellpadding=10 ><tr><td><table width='100%'>
<tr><td width='82%'>Име: <b>";
//ime = name
$write2 = "</b> от: ";
//ime = town
$write3 = "</font></td><td width='18%'><a href='mailto:";
//ime = mail
$write4 = "'>(E-mail)</a> <a href='http://";
//ime = http
$write5 = "'>(Web)</a></font></td></tr></table><table class='c' cellspacing=0 cellpadding=10><tr><td class='c'><font size='2'>";
//ime = comment
$write6 = "<br><br><div align='right'><font size='1'><i>Дата: $vreme IP-адрес: $ip</i></font></div></font></td></tr></table></table>";
$ip = $_SERVER['REMOTE_ADDR'];
umask(0);

$fp = fopen("posts/".$broi.".html", "w");
fwrite($fp, "$write1");
fwrite($fp, "$user");
fwrite($fp, "$write2");
fwrite($fp, "$town");
fwrite($fp, "$write3");
fwrite($fp, "$mail");
fwrite($fp, "$write4");
fwrite($fp, "$http");
fwrite($fp, "$write5");
fwrite($fp, "$msg");
fwrite($fp, "$write6");
fclose($fp);

umask(0);
$broi++;
$fp2 = fopen("db.php", "w");
$writedb = '<?php $broi='.$broi." ; ?>";
fwrite($fp2, "$writedb");
fclose($fp2);
$message = "Благодарим Ви за мнението!";
} else {
$message = "Не сте въвели информация!";
}
} else {
$message = "Грешен линк!";
}
?>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<META HTTP-EQUIV="Refresh" CONTENT="0; URL=index.php">
<title>Благодарим Ви!</title>
<body>
</body>
</html>



populni-kniga.html
<html>
<head><META HTTP-EQUIV="Content-Language" CONTENT="bg">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<link rel="stylesheet" href="files/font.css" type="text/css">
<script LANGUAGE="JavaScript" src="files/script.js" type="text/JavaScript"></script>
<title>Писане на съобщение</title>
</head>
<body ><br><br><br>
<table width=500 align="center" bordercolor='#D1E1ED' style='border: 1px solid #D1E1ED' bgcolor='#E8F0F7' cellspacing=0 cellpadding=10><tr><td>
<b><center>Писане на съобщение:</center></b>
<br>
<form action="kniga-save.php" method="post" name="form1">
<table border="0" cellspacing="2" cellpadding="0" align="center">
<tr>
<td width="100" align=right><b>Име:</b></td>
<td align=left>
<input name="име" type="text" id="име" size="31" maxlength=31>
</td>
</tr>
<tr>
<td width="100" align=right><b>Е-майл:</b></td>
<td align=left>
<input name="майл" type="text" id="майл" size="31" maxlength=31>
</td>
</tr>
<tr>
<td width="100" align=right><b>Уеб Адрес:</b></td>
<td align=left>
<input name="уеб" type="text" id="уеб" size="31" maxlength=31>
</td>
</tr>
<tr>
<td width="100" align=right><b>Град:</b></td>
<td align=left>
<input name="град" type="text" id="град" size="31" maxlength=31>
</td>
</tr>
<tr>
<td width="100">
<table align="center">
<caption><b><font size="1">Emoticons</font></b></caption>
<tr>
<td><a href="javascript:emoticon(':biggrin:');"><img src="smilies/biggrin.gif" border="0" ></a></td>
<td> <a href="javascript:emoticon(':cool:');"><img src="smilies/cool.gif" border="0" ></a></td>
<td><a href="javascript:emoticon(':cry:');"><img src="smilies/cry.gif" border="0" ></a></td>
<td><a href="javascript:emoticon(':dead:');"><img src="smilies/dead.gif" border="0" ></a></td>
</tr>
<tr>
<td><a href="javascript:emoticon(':eek:');"><img src="smilies/eek.gif" border="0" ></a></td>
<td><a href="javascript:emoticon(':embarrassed:');"><img src="smilies/embarrassed.gif" border="0" ></a></td>
<td><a href="javascript:emoticon(':laugh:');"><img src="smilies/laugh.gif" border="0" ></a></td>
<td><a href="javascript:emoticon(':love:');"><img src="smilies/love.gif" border="0" ></a></td>
</tr>
<tr>
<td> <a href="javascript:emoticon(':mad:');"><img src="smilies/mad.gif" border="0" ></a></td>
<td><a href="javascript:emoticon(':no:');"><img src="smilies/no.gif" border="0" ></a></td>
<td><a href="javascript:emoticon(':none:');"><img src="smilies/none.gif" border="0" ></a></td>
<td><a href="javascript:emoticon(':rolleyes:');"><img src="smilies/rolleyes.gif" border="0" ></a></td>
</tr>
<tr>
<td><a href="javascript:emoticon(':sad:');"><img src="smilies/sad.gif" border="0" ></a></td>
<td><a href="javascript:emoticon(':smile:');"><img src="smilies/smile.gif" border="0" ></a></td>
<td><a href="javascript:emoticon(':smilewinkgrin:');"><img src="smilies/smilewinkgrin.gif" border="0" ></a></td>
<td><a href="javascript:emoticon(':wink:');"><img src="smilies/wink.gif" border="0" ></a></td>
</tr>
</table>
</td>
<td> <INPUT onclick=b() type=button value="B" class="button">
<INPUT onclick=i() type=button value="I" class="button">
<INPUT onclick=u() type=button value="U" class="button">
<INPUT onclick=url() type=button value="Url" class="button">
<INPUT onclick=email() type=button value="Email" class="button"><br>
<form name=myform action="YOUR-SCRIPT.CGI">
<textarea name="мсг" wrap=physical cols="60" rows="9" onKeyUp="textCounter(this.form.мсг,this.form.remLen,800);" id="мсг"></textarea>
</td>
</tr>
<tr>
<td></td>
<td><input readonly type=text name=remLen size=3 maxlength=1 value="800">
<input name="Submit" type="submit" onClick="MM_validateForm('име','','R','майл','','NisEmail','мсг','','R');return document.MM_returnValue" value="Изпрати" class="button"> </form></td>
</tr>
</table>
</td></tr></table>


</body>
</html>




font.css
Body {
font-family: verdana, tahoma, arial, helvetica;
font-weight: normal;
font-size: 11px;
color: #005080;
background-color: #F5F9FC;
scrollbar-face-color: #E8F0F7;
scrollbar-highlight-color: #E8F0F7;
scrollbar-shadow-color: #99BCD7;
scrollbar-3dlight-color: #DCE8F1;
scrollbar-arrow-color: #99BCD7;
scrollbar-track-color: #E0EBF3;
scrollbar-darkshadow-color:#;
}
Table.border {
width: 100%;
color: #005080;
background: #E8F0F7;
border-style: solid;
border: solid 1px;
border-color: #C0D7E7 #74A5C9;
}
Table.fon {
width: 100%;
background: #E0EBF3;
border: 1px solid #99BCD7;
}
Table.b {
width: 100%;
background: #E8F0F7;
border: 1px solid #99BCD7;
font: normal 11px Verdana, Arial, Helvetica, sans-serif;
}
Table.c {
width: 100%;
border: 1px solid #D1E1ED;
font: normal 11px Verdana, Arial, Helvetica, sans-serif;
}

Td {
font-family: verdana, tahoma, helvetica;
font-size: 11px;
}

Td.a {
background: #D1E1ED;
}

Td.b {
font-family: verdana, tahoma, helvetica;
font-size: 11px;
color: #005080;
}

Td.c {
background: #F0F5F9;
font: normal 11px Verdana, Arial, Helvetica, sans-serif;
}

A:link {
background: none;
color: #6699CC;
text-decoration: none;
}
A:active {
background: none;
color: #6699CC;
text-decoration: none;
}
A:visited {
background: none;
color: #6699CC;
text-decoration: none;
}
A:hover {
background: none;
color: #005080;
text-decoration: underline;
}
Textarea {
border-color: #B3CDE1;
color: #2B4157;
font: normal 11px Verdana, Arial, Helvetica, sans-serif;
border-width: 1px 1px 1px 1px;
border: 1px solid #94BAD6;
background-color: #EDF3F8;
}
Input {
border-color: #D1E1ED;
color: #2B4157;
font: normal 11px Verdana, Arial, Helvetica, sans-serif;
border-width: 1px 1px 1px 1px;
border: 1px solid #94BAD6;
background-color: #EDF3F8;
}
Input.button {
border-color: #94BAD6;
background: #D1E1ED;
font: 10px Verdana, Arial, Helvetica, sans-serif;
border-width: 1px 1px 1px 1px;
}




script.js
<!--
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_validateForm() { //v4.0
var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
if (val) { nm=val.name; if ((val=val.value)!="") {
if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
if (p<1 || p==(val.length-1)) errors+='- '+nm+' -въведете коректен адрес.\n';
} else if (test!='R') { num = parseFloat(val);
if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
min=test.substring(8,p); max=test.substring(p+1);
if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' се изисква.\n'; }
} if (errors) alert('Открити са следните грешки:\n'+errors);
document.MM_returnValue = (errors == '');
}

function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//-->

function textCounter(field, countfield, maxlimit) {
if (field.value.length > maxlimit) // if too long...trim it!
field.value = field.value.substring(0, maxlimit);

else
countfield.value = maxlimit - field.value.length;
}
function b()
{
document.form1.мсг.value += ("")
}
function i()
{
document.form1.мсг.value += ("[i][/i]")
}
function u()
{
document.form1.мсг.value += ("[u][/u]")
}function url()
{
document.form1.мсг.value += ("[url][/url]")
}function email()
{
document.form1.мсг.value += ("[email][/email]")
}
function emoticon(text) {
var txtarea = document.form1.мсг;
text = ' ' + text;
if (txtarea.createTextRange && txtarea.caretPos) {
var caretPos = txtarea.caretPos;
caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? caretPos.text + text + ' ' : caretPos.text + text;
txtarea.focus();
} else {
txtarea.value += text;
txtarea.focus();
}
}


admin.php
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<title>Администраторски панел</title>
<link rel="stylesheet" href="../files/font.css" type="text/css">
</head>
<body>
<?php
include "../db.php";
session_start();
$potrebitel= $HTTP_POST_VARS['potrebitel'];
$pas= $HTTP_POST_VARS['pas'];
if ($potrebitel!='admin' || $pas!='admin')
{echo "

";
exit;}
else
{
$HTTP_SESSION_VARS['potrebitel']= $potrebitel;

}
?>
<table width="590" align="center">
<tr>
<td>
<?
for ($i=$broi; $i>0; $i--) {
if (is_file("../posts/".$i.".html")) {
include "../posts/".$i.".html";
echo " <a href='edit.php?file=".$i."' class='BlockTextSmall'>(<b>Добави отговор</b>)</a> ";
echo " <a href='del.php?file=".$i."' class='BlockTextSmall'>(<b>Изтриване</b>)</a> ";
echo "<br><br>";
}
}
?>
</td>
</tr>
</table>
</body>
</html>



del.php
<?
session_start();
if (isset($HTTP_SESSION_VARS['potrebitel']))
{
$potrebitel=$HTTP_SESSION_VARS['potrebitel'];
}
else
{
echo "Нямате достъп до тази страница";
exit;
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<META HTTP-EQUIV="Refresh" CONTENT="0; URL=../index.php">
</head>
<body>
<?php
umask(0);
$i = $_GET['file'];
umask(0);
unlink ("../posts/".$i.".html");
?>
</body>
</html>



edit.php
<?
session_start();
if (isset($HTTP_SESSION_VARS['potrebitel']))
{
$potrebitel=$HTTP_SESSION_VARS['potrebitel'];
}
else
{
echo "Нямате достъп до тази страница";
exit;
}
?>
<?php
$i = $_GET['file'];
?>
<html>
<head>
<link rel="stylesheet" href="../files/font.css" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">

<title>Добавяне на отговор...</title>
</head>

<body>
<script language="JavaScript">
function b()
{
document.form1.text.value += ("")
}
function i()
{
document.form1.text.value += ("[i][/i]")
}
function u()
{
document.form1.text.value += ("[u][/u]")
}function url()
{
document.form1.text.value += ("[url][/url]")
}function email()
{
document.form1.text.value += ("[email][/email]")
}


function emoticon(text) {
var txtarea = document.form1.text;
text = ' ' + text;
if (txtarea.createTextRange && txtarea.caretPos) {
var caretPos = txtarea.caretPos;
caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? caretPos.text + text + ' ' : caretPos.text + text;
txtarea.focus();
} else {
txtarea.value += text;
txtarea.focus();
}
}

</script>
<div align="center">
<table width="590" cellpadding="5" cellspacing="3">
<tr>
<td><?
include "../posts/".$i.".html";
?>
</td>
</tr>
<tr>
<td>


<div align="center"><form name="form1" method="post" action="post.php<?php echo "?post=".$i; ?>">
<table width=590 align="center" bordercolor='#D1E1ED' style='border: 1px solid #D1E1ED' bgcolor='#E8F0F7' cellspacing=0 cellpadding=10><tr><td>
<tr>
<td><b>Админ Отговор:</b></td>
</tr>
<tr>
<td>
<table align="center">
<caption><b><font size="1">Emoticons</font></b></caption>
<tr>
<td><a href="javascript:emoticon(':biggrin:');"><img src="smilies/biggrin.gif" border="0" ></a></td>
<td> <a href="javascript:emoticon(':cool:');"><img src="smilies/cool.gif" border="0" ></a></td>
<td><a href="javascript:emoticon(':cry:');"><img src="smilies/cry.gif" border="0" ></a></td>
<td><a href="javascript:emoticon(':dead:');"><img src="smilies/dead.gif" border="0" ></a></td>
</tr>
<tr>
<td><a href="javascript:emoticon(':eek:');"><img src="smilies/eek.gif" border="0" ></a></td>
<td><a href="javascript:emoticon(':embarrassed:');"><img src="smilies/embarrassed.gif" border="0" ></a></td>
<td><a href="javascript:emoticon(':laugh:');"><img src="smilies/laugh.gif" border="0" ></a></td>
<td><a href="javascript:emoticon(':love:');"><img src="smilies/love.gif" border="0" ></a></td>
</tr>
<tr>
<td> <a href="javascript:emoticon(':mad:');"><img src="smilies/mad.gif" border="0" ></a></td>
<td><a href="javascript:emoticon(':no:');"><img src="smilies/no.gif" border="0" ></a></td>
<td><a href="javascript:emoticon(':none:');"><img src="smilies/none.gif" border="0" ></a></td>
<td><a href="javascript:emoticon(':rolleyes:');"><img src="smilies/rolleyes.gif" border="0" ></a></td>
</tr>
<tr>
<td><a href="javascript:emoticon(':sad:');"><img src="smilies/sad.gif" border="0" ></a></td>
<td><a href="javascript:emoticon(':smile:');"><img src="smilies/smile.gif" border="0" ></a></td>
<td><a href="javascript:emoticon(':smilewinkgrin:');"><img src="smilies/smilewinkgrin.gif" border="0" ></a></td>
<td><a href="javascript:emoticon(':wink:');"><img src="smilies/wink.gif" border="0" ></a></td>
</tr>
</table>
</td>
<td><INPUT onclick=b() type=button value="B" class="button">
<INPUT onclick=i() type=button value="I" class="button">
<INPUT onclick=u() type=button value="U" class="button">
<INPUT onclick=url() type=button value="Url" class="button">
<INPUT onclick=email() type=button value="Email" class="button"><br><br>
<textarea name="text" cols="60" rows="9" id="text"></textarea>
<br><br>
<input name="Submit" type="submit" value="Готово">

</td></tr></table>
</form></div></td>
</tr>
</table>
</div>
</body>
</html>



post.php

<html>
<head>
<META HTTP-EQUIV="Refresh" CONTENT="0; URL=../index.php">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<title></title><body>
<?php


umask(0);
$i = $_GET['post'];
$comment = $_POST['text'];

$comment=str_replace("<",'<',$comment);
$comment=str_replace(">",'>',$comment);
$comment=preg_replace("/(\[b\])(.+?)(\[\/b\])/i", "<b>\\2</b>", $comment);
$comment=preg_replace("/(\[i\])(.+?)(\[\/i\])/i", "<i>\\2</i>", $comment);
$comment=preg_replace("/(\[u\])(.+?)(\[\/u\])/i", "<u>\\2</u>", $comment);
$comment=preg_replace("/(\[email=(.+?)\])(.+?)(\[\/email\])/i", '<a href="mailto:\\2" target="_blank">\\3</a>',$comment);
$comment=preg_replace("/(\[email\])(.+?)(\[\/email\])/i", '<a href="mailto:\\2">\\2</a>',$comment);
$comment=preg_replace("/(\[url\])(.+?)(\[\/url\])/i", '<a href="\\2" target="_blank">\\2</a>',$comment);
$comment=preg_replace("/(\[url=\])(.+?)(\[\/url\])/i", '<a href="\\2" target="_blank">\\2</a>',$comment);
$comment=preg_replace("/(\[url=(.+?)\])(.+?)(\[\/url\])/i", '<a href="\\2" target="_blank">\\3</a>',$comment);
$comment=str_replace(":biggrin:",'<img src=smilies/biggrin.gif>',$comment);
$comment=str_replace(":cool:",'<img src=smilies/cool.gif>',$comment);
$comment=str_replace(":cry:",'<img src=smilies/cry.gif>',$comment);
$comment=str_replace(":dead:",'<img src=smilies/dead.gif>',$comment);
$comment=str_replace(":eek:",'<img src=smilies/eek.gif>',$comment);
$comment=str_replace(":embarrassed:",'<img src=smilies/embarrassed.gif>',$comment);
$comment=str_replace(":laugh:",'<img src=smilies/laugh.gif>',$comment);
$comment=str_replace(":love:",'<img src=smilies/love.gif>',$comment);
$comment=str_replace(":mad:",'<img src=smilies/mad.gif>',$comment);
$comment=str_replace(":no:",'<img src=smilies/no.gif>',$comment);
$comment=str_replace(":none:",'<img src=smilies/none.gif>',$comment);
$comment=str_replace(":rolleyes:",'<img src=smilies/rolleyes.gif>',$comment);
$comment=str_replace(":sad:",'<img src=smilies/sad.gif>',$comment);
$comment=str_replace(":smile:",'<img src=smilies/smile.gif>',$comment);
$comment=str_replace(":smilewinkgrin:",'<img src=smilies/smilewinkgrin.gif>',$comment);
$comment=str_replace(":upset:",'<img src=smilies/upset.gif>',$comment);
$comment=str_replace(":wink:",'<img src=smilies/wink.gif>',$comment);
$comment=str_replace(":yes:",'<img src=smilies/yes.gif>',$comment);
umask(0);
$fp = fopen("../posts/".$i.".html", "a+");
$write1 = "<table width='590' class='b' align='center' cellpadding='0' cellspacing='1'><tr><td><b>Админ: </b>";
//tekst
$write2 = "</td></tr></table>";
fwrite($fp, "$write1");
fwrite($fp, "$comment");
fwrite($fp, "$write2");
fclose($fp);
$message = "Успешно !";
?>
</body>
</html>


index.html
<html>
<head>
</head>
<link rel="stylesheet" href="../files/font.css" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<body>
<FORM ACTION="admin.php" METHOD=POST>
<table align="center">
<caption><b>Контрол Панел</b></caption>
<tr>
<td><b>Потребител:</b></td>
<td><INPUT TYPE="text" NAME="potrebitel"></td>
</tr>
<tr>
<td><b>Парола:</b></td>
<td><INPUT TYPE="password" NAME="pas"></td>
</tr>
<tr>
<td></td>
<td><INPUT TYPE=submit VALUE="ВХОД"></td>
</tr>
</table>
</FORM>
</body>
</html>











/ Трябва да сте регистриран за да напишете коментар /
От: MARIJUANA48
6:59 23-11-2009
В admin.php не трябва да има session_start(); дава грешка ! като го махнете сичко си е наред.
От: Lacos7e
13:52 09-04-2010
А може ли да кажеш кой е кода да показва колко общо коментари има и да има примерно по 7 коментара на страница след седмия коментар по старите да отиват във 2-3-4 и т.н страница. Ще съм ти много благодарен :)
От: Lacos7e
14:01 09-04-2010
А може ли да кажеш кой е кода да показва колко общо коментари има и да има примерно по 7 коментара на страница след седмия коментар по старите да отиват във 2-3-4 и т.н страница. Ще съм ти много благодарен :)
От: Lacos7e
14:02 09-04-2010
А може ли да кажеш кой е кода да показва колко общо коментари има и да има примерно по 7 коментара на страница след седмия коментар по старите да отиват във 2-3-4 и т.н страница. Ще съм ти много благодарен :)
От: CeVo
23:41 18-04-2010
дай .fla файла на baners.swf
От: antontomov
11:58 04-05-2010
Благодаря ти много, чудесна е!
От: tanchev
1:36 04-07-2010
При мен не работи дава ми грешки :S
От: rexpage
12:37 11-02-2011
След като вляза в админ панела, не ми дава да Изтривам/Добавям отговор?
От: tanchev
12:38 04-04-2011
Нямате достъп до тази страница пише като се опиташ да изтриеш или редактираш пост >..
От: tanchev
12:42 04-04-2011
BTW: Преместете session_start() на ред 14 и всичко се оправя.
Благодаря за системката.
1