FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Visitor notebook for php





bykezzap
CREATE TABLE ziyaretci_defteri (
numara smallint(6) NOT NULL auto_increment,
isim text NOT NULL,
email text NOT NULL,
ulke text NOT NULL,
gorus longtext NOT NULL,
tarih datetime NOT NULL default '0000-00-00 00:00:00',
PRIMARY KEY (numara),
UNIQUE KEY numara (numara)
) TYPE=MyISAM;
<html>
<head><title>Ziyaretci Defteri - Gorusunuzu Yazininz (yaz.php)</title><head>
<body>
<form method="post" action="gonder.php">
Isminiz : <input type="text" name="isim"><br>
Email : <input type="text" name="email"><br>
Ulkeniz : <input type="text" name="ulke"><br>
Gorusleriniz : <textarea name="gorus"></textarea><br>
<br><br>
<input type="submit" name="valider" value="Gonder">
</form>
</body>
</html>
<html>
<head><title>Ziyaretci Defteri - Gorus Onayi (gonder.php)</title><head>
<body>
<?php
$db = mysql_connect(); //database baglantisi
$continu=1;
if ($isim == "")
{
print("Lutfen Isim bolumunu tam olarak doldurunuz!<br>"); //isim bolumu bos birakildiginda cikacak hata yazisi
$continu=0;
}

if ($continu == 1)
{
$date=date("Y-m-d");
$sql="INSERT INTO ziyaretci_defteri (isim, email, ulke, gorus, tarih) VALUES ('$isim', '$email', '$ulke', '$gorus', NOW())";
mysql_query($sql, $db);
print("Gorusleriniz Icin Tesekkurler !") ; //gonderilme islemi tamamlandiginda cikacak yazi
}
else
{
print("<a href=yaz.php>Geri</a>");
}
?>
<br><?php print("<a href=oku.php>Defteri Oku</a>"); ?>
</body>
</html>
$continu=1;
if ($isim == "")
{
print("Lutfen Isim bolumunu tam olarak doldurunuz!<br>");
$continu=0;
}

Ardindan verilen bilgilerin ana tablomuzda yerli yerine oturmasini sagladik ve adreslerini tam olarak belirledik.

$sql="INSERT INTO ziyaretci_defteri (isim, email, ulke, gorus, tarih) VALUES ('$isim', '$email', '$ulke', '$gorus', NOW())";

<html>
<head><title>Ziyaretci Defteri - Gorusleri Oku (oku.php)</title><head>
<body>
<table align="center" cellspacing="0" cellpadding="0" border="1" width="80%">
<tr>
<td bgcolor="black"><font color="white">Isim</td>
<td bgcolor="black"><font color="white">Email</td>
<td bgcolor="black"><font color="white">Ulke</td>
<td bgcolor="black"><font color="white">Gorusler</td>
<td bgcolor="black"><font color="white">Tarih</td>
</tr>

<?php
$db = mysql_connect(); //database baglantisi
$sql="SELECT * FROM ziyaretci_defteri ORDER BY numara"; //siralamanin yapilacagi tablonun secimi.
$res=mysql_query($sql, $db);
while ($ligne = mysql_fetch_object ($res))
{
print "<tr>";
print "<td>$ligne->isim</td>";
print "<td>$ligne->email</td>";
print "<td>$ligne->ulke</td>";
print "<td>$ligne->gorus</td>";
print "<td>$ligne->tarih</td>";
print "</tr>";
}
mysql_free_result ($res);
?>
</table>
<br><?php print("<a href=yaz.php>Deftere Yaz</a>"); ?>
</body>
</html
charliehk
Could someone translate it into English? thank you!
thexalchemist
There are many GuestBook Alternatives. some MySql is not required. http://www.phpjunkyard.com/php-guestbook-script.php is one of them. Pretty Easy to use.
Related topics
http://tuvanonline.com/library/index.php
Visitor ip PHP (E107)
How To : Secure Your PHP Website
PHP & Chat
Ip Banning Using Php
PHP Counter?
I need PHP hits code
[PHP] Weird Errors and lost files.
Can PHP do this?
PHP and Mysql Project. Help
How can I run PHP on IIS?
Visitor information
Hide PHP file extension
301 redirection in PHP and .htaccess
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.