Mal wieder dabei... Ich lern es nochmal irgendwann...*gg... als newbie nicht so einfach...
also ich hab hier ein script
wo er mir (wie er auch soll) am Anfang die Variabeln anzeigt...
Alles anzeigen
was mir aufgefallen ist...
wenn ich den Admin button nach der klammer setz, ist die Variabeln vorhanden, nur vor der Klammer nicht...
Vielleicht könnt ihr mir ein Tip geben/Helfen...
Mit session_start (); kann ich die variabeln auch net zurückhohlen...
greets
also ich hab hier ein script
wo er mir (wie er auch soll) am Anfang die Variabeln anzeigt...
array(1) { [0]=> array(41) { [0]=> string(1) "1" ["id"]=> string(1) "1" [1]=> string(7) "Tristar" ["login"]=> string(7) "Tristar" [2]=> string(32) "f867113174ccc776dbc75fef16744b95"
Quellcode
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
- <HTML>
- <HEAD>
- <TITLE>Gästebuch</TITLE>
- </HEAD>
- <STYLE>
- BODY { background-color:#113a67; font-family:Verdana,Arial,Tahoma; font-size:8pt; color:#ffffff }
- A { font-family:Verdana,Arial,Tahoma; font-size:8pt; color:#ffaf49 }
- H1 { font-family:Verdana,Arial,Tahoma; font-size:16pt; color:#ffaf49 }
- HR { color:#ffffff }
- TD { font-family:Verdana,Arial,Tahoma; font-size:8pt; color:#ffffff }
- INPUT,TEXTAREA { background-color:#517aa7; border:1px solid #ffffff; font-family:Arial,Tahoma; font-size:8pt; color:#ffffff; }
- </STYLE>
- <BODY>
- <?
- ##### Admin-Passwort #####
- $adminpasswort="12345";
- // Umstellung auf reg_glo=Off Anfang
- $PHP_SELF = $_SERVER['PHP_SELF'];
- foreach($_POST as $key => $value) {
- $$key = isset($_POST[$key]) ? strip_tags($_POST[$key], "<b><i><strong>") : "";
- }
- foreach($_GET as $key => $value) {
- $$key = isset($_GET[$key]) ? $_GET[$key] : "";
- }
- // Umstellung auf reg_glo=Off ENDE
- ########### HAUPTPROGRAMM ###########
- $eintrag = isset($_POST['eintrag']) ? $_POST['eintrag'] : "";
- $senden = isset($_POST['senden']) ? $_POST['senden'] : "";
- $nname = isset($_POST['nname']) ? htmlspecialchars($_POST['nname']) : "";
- $kommentar = isset($_POST['kommentar']) ? $_POST['kommentar'] : "";
- $kommentar = strip_tags($kommentar,"<b><i><strong>"); // Mehr Sicherheit
- $admin_login = isset($_GET['admin_login']) ? $_GET['admin_login'] : "";
- $admin = isset($_POST['admin']) ? $_POST['admin'] : "";
- $loeschen = isset($_POST['loeschen']) ? $_POST['loeschen'] : "";
- $passwort = isset($_POST['passwort']) ? $_POST['passwort'] : "";
- $to_delete = isset($_POST['to_delete']) ? $_POST['to_delete'] : "";
- if ($eintrag) { eintrag(); }
- else if ($senden) { auswertung($kommentar,$nname,$hpage,$email); }
- else if ($admin_login) { admin_login(); }
- else if ($admin) { admin($passwort); }
- else if ($loeschen) { loeschen($to_delete); }
- else gaestebuch_zeigen();
- ########### FUNKTIONEN ###########
- function gaestebuch_zeigen ()
- {
- global $PHP_SELF;
- echo <<<FORMULAR
- <h1>Gästebuch</h1>
- <center>
- FORMULAR;
- $eintrag=array();
- $lesen=array();
- $teil=array();
- if (file_exists("gbuch.txt")) {
- $datei=fopen("gbuch.txt","r");
- while (!feof($datei)) {
- $lesen=fgets($datei,100000);
- array_push($eintrag,$lesen);
- }
- array_pop($eintrag);
- arsort($eintrag);
- foreach ($eintrag as $zeile) {
- $teil=explode("|",$zeile);
- $sekunden=$teil[0];
- $zeit=$teil[1];
- $name=$teil[2];
- $text=$teil[3];
- echo "<p align=\"justify\" style=\"margin-left:17pt;margin-right:25pt\">\n";
- echo"$zeit<br>\n";
- echo "<img src=\"gb_person.gif\" width=\"12\" height=\"12\" border=\"0\" vspace=\"0\"> $name<br>\n";
- echo "<p align=\"justify\" style=\"margin:40pt; margin-top:0pt; margin-bottom:0pt\">$text</p>";
- echo "</p>\n";
- echo"<hr width=\"80%\" color=\"#2f5a4f\" size=\"1\">\n";
- }
- }
- var_dump($userpro);
- echo "<p align=\"right\"><a href=\"{$_SERVER['PHP_SELF']}?include=43&session_id=<?=$session_id?>&admin_login=true\">Admin</a>\n";
- }
- var_dump($userpro);
- function eintrag()
- {
- global $PHP_SELF;
- global $nname;
- global $kommentar;
- $ua=getenv("HTTP_USER_AGENT");
- if (1*strpos(strtolower($ua),"msie")>0) {
- $breite1=38;
- $breite2=62;
- } else {
- $breite1=22;
- $breite2=30;
- }
- ?>
was mir aufgefallen ist...
wenn ich den Admin button nach der klammer setz, ist die Variabeln vorhanden, nur vor der Klammer nicht...
Vielleicht könnt ihr mir ein Tip geben/Helfen...
Mit session_start (); kann ich die variabeln auch net zurückhohlen...
greets