ronpepa
|
User
|
|
registriert
|
14.07.2008
|
wohnt in
|
|
Beiträge
|
1
|
|
HAllo freunde Bin ein noch ein Grünschnabel was das angeht .
Versuche ein Gästebuch zu erstellen mit hilfe von Büchern Smile
Jetzt hab ich ein Problem ein Admin Seite zu erstellen indem ich schlechte einträge weglöschen kann ??
Ganz unten ahbe ich ein Admin Link schon erstellt.
Ein Admin bereich wie auf den Datenbank zugreifen kann auch.
Aber Über den Link komm ich sofort rein ins DAten bank Ohne das ich nach User/ PAss gefragt werde.
Wie könnte ich das verwirklichen??
Bitte um Verstandliche Antworten Sad wie gesagt noch ein Newbee.
Hier ist mein gaestebuch PHP PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Unser Gästebuch</title>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
<meta http-equiv="expires" content="0" />
<meta name="author" content="" />
<meta name="description" content="">
<meta name="keywords" lang="" content="">
<meta name="generator" content="Web2Date BASIC" />
<link rel="stylesheet" type="text/css" href="../assets/sf.css" />
<link rel="stylesheet" type="text/css" href="../assets/sd.css" />
<link rel="stylesheet" type="text/css" href="../assets/sc.css" />
<script type="text/javascript" src="../assets/m.js"></script>
</head>
<body>
<div id="logo">PM Globe </div>
<div id="eyecatcher"><img src="../images/peye.jpg" width="200" height="500" alt="" border="0"></div>
<div id="plaintext">
<a href="../plaintext/index.php">Text version</a>
</div>
<form class="search" action="../fts.php" method="get">
<input class="search" type="text" name="criteria" maxlength="30" />
<input type="image" src="../images/psearch.gif" />
</form>
<div id="plaintext">
<a href="../plaintext/index.php">Text version</a>
</div>
<div id="common">
<br />
<a href="../kontakt.html">Kontakt</a>
<a href="../impressum.html">Impressum</a>
<a href="../haftungsausschluss.html">Haftungsausschluss</a>
<a href="../vonaz.html">Von A-Z</a>
<br />
</div>
<div id="topicmenu1" class="menu">
<a class="menuItem" href="../home/rundgang/index.php" onmouseover="return subMenuTouch(event, '');">Rundgang</a>
<a class="menuItem" href="../home/rooms/rooms.php" onmouseover="return subMenuTouch(event, '');">Rooms</a>
<a class="menuItem" href="../home/team/index.php" onmouseover="return subMenuTouch(event, '');">Team</a>
<a class="menuItem" href="../home/philosophie/index.php" onmouseover="return subMenuTouch(event, '');">Philosophie</a>
<a class="menuItem" href="../home/lage/index.php" onmouseover="return subMenuTouch(event, '');">Lage</a>
<a class="menuItem" href="../home/buchung/index.php" onmouseover="return subMenuTouch(event, '');">Buchung</a>
<a class="menuItem" href="../home/anfahrt/index.php" onmouseover="return subMenuTouch(event, '');">Anfahrt</a>
</div>
<div id="topicmenu2" class="menu">
<a class="menuItem" href="../studio/restaurant/index.html" onmouseover="return subMenuTouch(event, 'subtopicmenu21');">Künstler</a>
<a class="menuItem" href="../studio/cafe/index.html" onmouseover="return subMenuTouch(event, 'subtopicmenu22');">Pro´s</a>
</div>
<div id="topicmenu3" class="menu">
<a class="menuItem" href="../events/tagungen/index.html" onmouseover="return subMenuTouch(event, '');">Coming soon</a>
<a class="menuItem" href="../events/ontherun/ontherun.html" onmouseover="return subMenuTouch(event, '');">on the run</a>
</div>
<div id="topicmenu4" class="menu">
<a class="menuItem" href="../service/kosten/kosten.html" onmouseover="return subMenuTouch(event, '');">Kosten</a>
<a class="menuItem" href="../service/termine/termine.php" onmouseover="return subMenuTouch(event, '');">Termine</a>
<a class="menuItem" href="../service/contact/contact.html" onmouseover="return subMenuTouch(event, '');">Contact</a>
</div>
<div id="subtopicmenu21" class="menu">
<a class="menuItem" href="../studio/restaurant/desserts/index.html">Homeles</a>
</div>
<div id="subtopicmenu22" class="menu">
<a class="menuItem" href="../studio/cafe/eis/index.html">Hiphop</a>
<a class="menuItem" href="../studio/cafe/kuchenundgebaeck/index.html">House</a>
<a class="menuItem" href="../studio/cafe/getraenke/index.html">POP</a>
</div>
<div id="menuBar"><a class="menuButton" href="../index.php" onmouseover="menuTouch(event, '');">Home</a><a class="menuButton" href="../home/home.php" onmouseover="menuTouch(event, 'topicmenu1');">Home</a><a class="menuButton" href="../studio/index.html" onmouseover="menuTouch(event, 'topicmenu2');">Studio</a><a class="menuButton" href="../events/index.html" onmouseover="menuTouch(event, 'topicmenu3');">Events</a><a class="menuButton" href="../service/index.html" onmouseover="menuTouch(event, 'topicmenu4');">Service</a><a class="menuButton" style="font-weight:bold;color: #789D74;" href="./gaestebuch.php" onmouseover="menuTouch(event, '');">Gästebuch</a><a class="menuButton" href="../sitemap/index.html" onmouseover="menuTouch(event, '');">Sitemap</a></div>
<div id="content">
<div id="more">
<p><a target="_blank" href="../printable/gaestebuch/gaestebuch.php">Printable Version</a></p>
</div>
<h1>Unser Gästebuch</h1>
<h2><a name="000003957f1100a83"></a>Vielen Dank für Ihren Besuch!</h2>
<div class="sidepicture">
<p>
<div class="pictureframe"><img src="../images/ss14014_156.jpg" width="156" height="156" alt="" border="0"></div>
</p>
<h3>Unser Gästebuch</h3>
<p>Tragen Sie sich ein. Sagen Sie uns Ihre Meinung.</p>
</div>
<p>Wir danken für den Besuch auf unserer Website und würden uns freuen, wenn Sie sich die Zeit nehmen, sich in unser Gästebuch einzutragen. Vielen Dank!<br><br>Ihr Team vom Hotel Bellevue</p>
<div class="clearer"></div>
<h2><a name="000003957f1101f84"></a>Bitte tragen Sie sich ein!</h2>
<?php
function gbpostVars($myKey) {
// Holt Post-Vars
global $HTTP_POST_VARS;
if (isset($HTTP_POST_VARS[$myKey])) {
if (get_magic_quotes_gpc()) {
return (stripslashes($HTTP_POST_VARS[$myKey]));
} else {
return ($HTTP_POST_VARS[$myKey]);
}
}
else {
return ("");
}
}
function gbNLBR($text) {
$text=htmlentities($text);
$text=str_replace("\n","<br>",$text);
$text=str_replace("\r","",$text);
return ($text);
}
function gbgetVars($myKey) {
// Holt Get-Vars
global $HTTP_GET_VARS;
if (isset($HTTP_GET_VARS[$myKey])) {
if (get_magic_quotes_gpc()) {
return (stripslashes($HTTP_GET_VARS[$myKey]));
} else {
return ($HTTP_GET_VARS[$myKey]);
}
}
else {
return ("");
}
}
function gbServerVars($myKey) {
// Holt Server-Vars
global $HTTP_SERVER_VARS;
if (isset($HTTP_SERVER_VARS[$myKey])) {
return ($HTTP_SERVER_VARS[$myKey]);
}
else {
return ("");
}
}
function gbfwritePad($fp,$myVar,$length) {
// Schreibt gepadded in Datei
fwrite($fp,$myVar.str_repeat(" ",$length),$length);
}
function gbfgetPad($fp,$length) {
// Liest gepaddete Daten
return rtrim(fread($fp,$length));
}
function gbformatText($text) {
// Ersetzt BB-Formate
$text=str_replace("","<i>",$text);
$text=str_replace("","</i>",$text);
$text=str_replace("","<b>",$text);
$text=str_replace("","</b>",$text);
$text=str_replace("Smile"," <img src=w2dgbsmile.gif border=0> ",$text);
$text=str_replace("Wink"," <img src=w2dgbwink.gif border=0> ",$text);
$text=str_replace("Surprised"," <img src=w2dgbeek.gif border=0> ",$text);
$text=str_replace("Sad"," <img src=w2dgbsad.gif border=0> ",$text);
$text=str_replace("Surprised"," <img src=w2dgbwow.gif border=0> ",$text);
$text=str_replace("Rolling Eyes"," <img src=w2dgbroll.gif border=0> ",$text);
$text=str_replace("Laughing"," <img src=w2dgblol.gif border=0> ",$text);
$text.="</i></b>";
return($text);
}
$filename="../assets/plugindata/w2dgbf2f83a253e1ab9e395421a80b107cea3.dat";
$maxpage=9;
// Daten schreiben
if (gbgetVars("action")=="post") {
$pos=0;
// Position ermitteln
if (!file_exists($filename)) {
// Neue Datei
$fp=fopen($filename,"w");
flock ($fp,2);
gbfwritePad($fp,1,6);
flock ($fp,3);
fclose($fp);
$pos=1;
$fp=fopen($filename,"r+");
flock ($fp,2);
} else {
// Anhängen
$fp=fopen($filename,"r+");
flock ($fp,2);
$pos=gbfgetPad($fp,6);
$pos++;
fseek($fp,0);
gbfwritePad($fp,$pos,6);
}
// Schreiben
fseek($fp,6+($pos-1)*4890);
if ($admin) {
gbfwritePad($fp,0,1);
} else {
gbfwritePad($fp,1,1);
}
gbfwritePad($fp,gbServerVars("REMOTE_ADDR"),15);
gbfwritePad($fp,gbpostVars("username"),256);
gbfwritePad($fp,substr(gbNLBR(gbpostVars("message")),0,4096),4096);
gbfwritePad($fp,gbpostVars("email"),256);
gbfwritePad($fp,gbpostVars("www"),256);
gbfwritePad($fp, date("d.m.Y"),10);
flock ($fp,3);
fclose($fp);
// Benutzerinterface
echo("<p>Vielen Dank für Ihren Eintrag in unser Gästebuch. Wir freuen uns über jeden Besucher und nehmen Kritik und Anregungen sehr ernst.<br><br>\n");
echo("<a class='s2d' href='gaestebuch.php'>Das Gästebuch anzeigen</a></p>\n");
}
if (gbgetVars("action")=="") {
// Anzeigen
$displaycount=0;
if (file_exists($filename)) {
$fp=fopen($filename,"r");
flock ($fp,1);
$recordcount=gbfgetPad($fp,6);
$first=gbgetVars("offset");
if ($first==0) {
$first=1;
};
$last=$first+$maxpage-1;
for ($i=1; $i<=$recordcount; $i++) {
fseek($fp,6+($recordcount-$i)*4890);
$view=gbfgetPad($fp,1);
gbfgetPad($fp,15);
if ($view==1) {
$displaycount++;
if ($i>=$first && $i<=$last) {
$username=gbfgetPad($fp,256);
$message=gbfgetPad($fp,4096);
$email=gbfgetPad($fp,256);
$www=gbfgetPad($fp,256);
$date=gbfgetPad($fp,10);
echo("<p>");
echo("<b>$date</b> - ");
if ($email=="") {
echo(htmlentities($username));
} else {
echo("<a class='s2d' href='mailto:$email'>");
echo(htmlentities($username));
echo("</a>\n");
}
if ($www!="") {
if (substr($www,0,7)!="http://") {
$wwwplus="http://".$www;
} else {
$wwwplus=$www;
}
echo(" <a class='s2d' href='$wwwplus'>");
echo("(".htmlentities($www).")");
echo("</a>\n");
}
echo("<br>\n");
echo(gbformatText($message)."</p>\n");
}
}
}
flock ($fp,3);
fclose ($fp);
}
// Navigation
echo("<p>\n");
echo("<a class='s2d' href='gaestebuch.php?action=form'>Hier klicken, um einen Eintrag zu schreiben</a><br>\n");
if ($displaycount!=0) {
if ($first>1) {
print "<a class='s2d' href='gaestebuch.php?offset=".($first-$maxpage)."'>Zurück</a> ";
};
$page=0;
if ($displaycount>$maxpage) {
for ($i=1;$i<=$displaycount;$i=$i+$maxpage) {
$page++;
if ($i==$first) {
print " <strong>$page</strong> ";
} else {
print "<a class='s2d' href='gaestebuch.php?offset=".$i."'>$page</a> ";
}
}
}
if ($displaycount>$last) {
print "<a class='s2d' href='gaestebuch.php?offset=".($first+$maxpage)."'>Weiter</a> ";
}
}
echo("</p>\n");
}
if (gbgetVars("action")=="form") { ?>
<script language="JavaScript">
var gbisbold;
var gbisitalic;
function gbStoreCaret(textEl) {
if (textEl.createTextRange) textEl.caretPos = document.selection.createRange().duplicate();
}
function gbemoti(code) {
document.gbpostform.message.focus();
if (document.gbpostform.message.createTextRange && document.gbpostform.message.caretPos) {
document.gbpostform.message.caretPos.text=code;
gbStoreCaret(document.gbpostform.message);
} else {
document.gbpostform.message.value+=(" "+code+" ");
}
}
function gbmakebold() {
document.gbpostform.message.focus();
if (document.gbpostform.message.createTextRange && document.gbpostform.message.caretPos) {
mySelection=document.gbpostform.message.caretPos.text;
if (mySelection) {
document.gbpostform.message.caretPos.text=""+mySelection+"";
document.gbpostform.message.focus();
gbStoreCaret(document.gbpostform.message);
} else {
if (gbisbold) {
document.gbpostform.message.caretPos.text='[/b]';
gbisbold=false;
} else {
document.gbpostform.message.caretPos.text='';
gbisbold=true;
}
gbStoreCaret(document.gbpostform.message);
}
} else {
if (gbisbold) {
document.gbpostform.message.value+='';
gbisbold=false;
} else {
document.gbpostform.message.value+='[b]';
gbisbold=true;
}
}
}
function gbmakeitalic() {
document.gbpostform.message.focus();
if (document.gbpostform.message.createTextRange && document.gbpostform.message.caretPos) {
mySelection=document.gbpostform.message.caretPos.text;
if (mySelection) {
document.gbpostform.message.caretPos.text=""+mySelection+"";
document.gbpostform.message.focus();
gbStoreCaret(document.gbpostform.message);
} else {
if (gbisitalic) {
document.gbpostform.message.caretPos.text='[/i]';
gbisitalic=false;
} else {
document.gbpostform.message.caretPos.text='';
gbisitalic=true;
}
gbStoreCaret(document.gbpostform.message);
}
} else {
if (gbisitalic) {
document.gbpostform.message.value+='';
gbisitalic=false;
} else {
document.gbpostform.message.value+='[i]';
gbisitalic=true;
}
}
}
function gbvalidate() {
var pattern=/.*\@.*\..*/;
if (document.gbpostform.username.value=="") {
document.gbpostform.username.focus();
document.gbpostform.username.select();
alert ("Bitte geben Sie Ihren Namen an.");
return(false);
}
if ((pattern.test(document.gbpostform.email.value))==false) {
document.gbpostform.email.focus();
document.gbpostform.email.select();
alert ("Bitte geben Sie eine gültige E-Mail-Adresse ein.");
return(false);
}
if (document.gbpostform.message.value=="") {
document.gbpostform.message.focus();
document.gbpostform.message.select();
alert ("Bitte geben Sie Ihre Nachricht ein.");
return(false);
}
if (document.gbpostform.message.value.length>4096) {
document.gbpostform.message.focus();
document.gbpostform.message.select();
alert ("Die eingegebene Nachricht ist zu lang. Bitte geben Sie eine kürzere Nachricht ein.");
return(false);
}
document.gbpostform.submit;
}
</script>
<form onsubmit="return gbvalidate()" action="gaestebuch.php?action=post" method="post" name="gbpostform">
<table>
<tr>
<td class='s2d'>Name:</td><td class='s2d'><input style="width: 340px;" class='s2d' type="text" name="username" maxlength="255"><br></td>
</tr>
<tr>
<td class='s2d'>E-Mail:</td><td class='s2d'><input style="width: 340px;" class='s2d' type="text" name="email" maxlength="255"><br>
</tr>
<tr>
<td class='s2d'>WWW:</td><td class='s2d'><input style="width: 340px;" class='s2d' type="text" name="www" maxlength="255"><br>
</tr>
<tr>
<td class='s2d' valign="top">Eintrag:</td><td class='s2d'><textarea style="width: 340px;" cols="40" rows="10" name="message" onselect="gbStoreCaret(this);" onclick="gbStoreCaret(this);" onkeyup="gbStoreCaret(this);"></textarea><br>
</tr>
<tr>
<td></td>
<td class='s2d'>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="left" valign="middle">
<a class='s2d' href="javascript:gbemoti('Smile')"><img src="w2dgbsmile.gif" width="15" height="15" border="0" alt=""></a>
<a class='s2d' href="javascript:gbemoti('Wink')"><img src="w2dgbwink.gif" width="15" height="15" border="0" alt=""></a>
<a class='s2d' href="javascript:gbemoti('Surprised')"><img src="w2dgbeek.gif" width="15" height="15" border="0" alt=""></a>
<a class='s2d' href="javascript:gbemoti('Sad')"><img src="w2dgbsad.gif" width="15" height="15" border="0" alt=""></a>
<a class='s2d' href="javascript:gbemoti('Surprised')"><img src="w2dgbwow.gif" width="15" height="15" border="0" alt=""></a>
<a class='s2d' href="javascript:gbemoti('Rolling Eyes')"><img src="w2dgbroll.gif" width="15" height="15" border="0" alt=""></a>
<a class='s2d' href="javascript:gbemoti('Laughing')"><img src="w2dgblol.gif" width="15" height="15" border="0" alt=""></a>
</td>
<td align="right" valign="middle"><a class='s2d' href="javascript:gbmakebold()">fett</a> <a class='s2d' href="javascript:gbmakeitalic()">kursiv</a></td>
</tr>
</table>
</td>
</tr>
<tr>
<td></td>
<td class='s2d' align="right"><br><input type="image" src="../images/s2dguestbook.gif" border="0" alt="Eintrag speichern">
</td>
</form>
</tr>
</table>
<?php } ?><br />
<br />
</div>
<div id="sidebar">
<h2>Die besten Urlaubstipps</h2>
<p>finden Sie in unserem Servicebereich. Klicken Sie auf einen der unten stehenden Links, um mehr über das Umland und die nahe liegenden Ausflugsziele erfahren möchten.</p><br/>
<p>
<a href="../service/kosten/flussfahrten.html">Flussfahrten</a>
</p>
<p>
<a href="../service/kosten/heimatmuseum.html">Heimatmuseum Musterstadt</a>
</p>
<p>
<a href="../service/kosten/stbernhard.html">St. Bernhard</a>
</p>
<p>
<a href="Question../gaestebuch/admin.php">ADMIN</a>
</p>
<br/>
</div>
</body>
</html>
|