php.de

Zurück   php.de > Webentwicklung > PHP Einsteiger > PHP Tipps 2004-2

 
 
LinkBack Themen-Optionen Thema bewerten
Alt 17.11.2004, 20:30  
Gast
 
Beiträge: n/a
Standard [Erledigt] Problem mit Anmeldungs-script

HioH Leutz
Jetzt hab ich n Problem mit meinem Anmeldungs formular. und zwar werden von "formular.php" zu "auswertung.php" die Variablen nicht übertragen. Wer sich die Mühe machen will und die beiden langen scripte sich anschauen will, dem wäre ich sehr dankbar. Es kommt auf den unteren Teil der scripte an !!!

Code:
/// formular.php ///

<html>
<head>
<title></title>
</head>
<body  text="#FFFFFF" bgcolor="#C0C0C0" link="#FFFFFF" alink="#FFFFFF" vlink="#FFFFFF">
<?php
$Datenserver="localhost";
$user="lionhair";
$pass="";
$verbindung = mysql_connect($Datenserver, $user, $pass);
$dbname= "db_local";
$d=mysql_select_db($dbname, $verbindung);
$sql ="SELECT * FROM login";
$ergebnis= mysql_query($sql,$verbindung);
$zeile = mysql_num_rows($ergebnis);

echo"<div align='center'><table width='960' height='20%'>";
echo"<tr>";
 echo"<td>";
 echo"<div align='center'>";
 echo"<table border='1' cellpadding='0' cellspacing='0' bgcolor='#928D89' width='100%' height='100%'>";
echo"<tr>";
 echo"<td>";
 echo"

</p>";
 echo"<div align='center'>

[img]Banner.jpg[/img]</p></div>";

 echo"

</p></td>";
echo"</tr>";
echo"</table>";
 echo"</div>";
 echo"</td>";
 echo"</tr>";
echo"</table></div>";
echo"

";
echo"<table width='100%' height='45%'>";
echo"<tr>";

 echo"<td width='34%'VALIGN='top'>";
  echo"<center><table border='1' cellpadding='0' cellspacing='0' bgcolor='#494949' width='303' height='5%'>";
echo"<tr>";
 echo"<td><div align='center'><u>Login</u></div></td>";
echo"</tr>";
echo"</table>";
echo"<table border='1' cellpadding='0' cellspacing='0' bgcolor='#B4B0AD' width='303' height='15%'>";
  echo"<tr>";
echo"<form action='session.php'   method='post' name='login'>";
echo"<td>Username:</td>";
echo"<td><input type='text' name='user1' size='35'></td>";
echo"</tr>";
echo"<tr>";
echo"<td>Passwort:</td>";
echo"<td><input type='password' name='password1' size='35'></td>";
echo"</tr>";
echo"<tr>";
echo"<td><div align='center'><input type='submit' value='Login' name='loginr'></div></form></td>";
echo"<form action='formular.php'  name='anmelden'>";
echo"<td><div align='center'><input type='submit' value='Anmelden' name='anmeldung'></div></form></form></td>";
 echo"</tr>";
echo"</table>";
echo"

</p>";
 echo"<table border='1' cellpadding='0' cellspacing='0' bgcolor='#494949' width='303' height='5%'>";
echo"<tr>";
 echo"<td><div align='center'><u>Menü</u></div></td>";
echo"</tr>";
echo"</table>";
echo"<table border='1' cellpadding='0' cellspacing='0' bgcolor='#B4B0AD' width='303' height='5%'>";
echo"<tr>";
 echo"<td><div align='center'>Home</div></td>";
echo"</tr>";
echo"</table>";
echo"<table border='1' cellpadding='0' cellspacing='0' bgcolor='#B4B0AD' width='303' height='5%'>";
echo"<tr>";
 echo"<td><div align='center'>Pics</div></td>";
echo"</tr>";
echo"</table>";
echo"<table border='1' cellpadding='0' cellspacing='0' bgcolor='#B4B0AD' width='303' height='5%'>";
echo"<tr>";
 echo"<td><div align='center'>Kontakt</div></td>";
echo"</tr>";
echo"</table></center>";
 echo"</td>";
 echo"<td  VALIGN='top'>";
echo"<form action='auswertung.php' method='post'>";
echo"<center>";
echo"<table border='1' cellpadding='0' cellspacing='0' bgcolor='#494949' width='490' height='5%'>";
echo"<tr >";
 echo"<td><div align='center'><u>Anmeldung</u></div></td>";
echo"</tr>";
echo"</table>";
echo"<table border=\"1\" cellpadding=\"0\" cellspacing=\"0\" bgcolor='#B4B0AD' width='490' height='80%'>";
echo"<tr>";
  echo"<td align=\"right\">Username:</td>";
  echo"<td>";
  echo"<input name=\"Username\" type=\"=text\" size=\"30\" maxlength=\"30\"></td>";
 echo"</tr>";
 echo"<tr>";
  echo"<td align=\"right\">Vorname:</td>";
  echo"<td><input name=\"Vorname\" type=\"=text\" size=\"30\" maxlength=\"30\"></td>";
 echo"</tr>";
 echo"<tr>";
  echo"<td align=\"right\">Nachname:</td>";
  echo"<td>";
  echo"<input name=\"Nachname\" type=\"=text\" size=\"30\" maxlength=\"30\"></td>";
 echo"</tr>";
 echo"<tr>";
  echo"<td align=\"right\">Straße:</td>";
  echo"<td><input name=\"Straße\" type=\"=text\" size=\"30\" maxlength=\"30\"></td>";
 echo"</tr>";
  echo"<tr>";
  echo"<td align=\"right\">PLZ:</td>";
  echo"<td><input name=\"PLZ\" type=\"=text\" size=\"30\" maxlength=\"30\"></td>";
 echo"</tr>";
  echo"<tr>";
  echo"<td align=\"right\">Ort:</td>";
  echo"<td><input name=\"Ort\" type=\"=text\" size=\"30\" maxlength=\"30\"></td>";
 echo"</tr>";
  echo"<tr>";
  echo"<td align=\"right\">E-Mail Adresse:</td>";
  echo"<td><input name=\"Mail\" type=\"=text\" size=\"30\" maxlength=\"30\"></td>";
 echo"</tr>";
   echo"<tr>";
  echo"<td align=\"right\">Passwort:</td>";
  echo"<td><input name=\"Passwort\" type='password' size=\"30\" maxlength=\"30\"></td>";
 echo"</tr>";
echo "</table></center>";
echo"

</p>";
echo"<center><table>";
echo"<tr>";
echo"<td><input type='Submit' name='weiter' value='Weiter'></td>";
echo"</form>";
echo"<form action=\"index.html\" method='post'>";
echo"<td><input type='Submit' name='zrueck' value='Zur&uuml;ck'></td>";
echo"</form>";
echo"</tr>";
echo"</table></center>";
echo"</td>";
 echo"</tr>";
echo"</table>";

echo"</p>";
?>
</body>
</html>
Code:
/// auswertung.php ///

<html>
<head>
<title></title>
</head>
<body  text="#FFFFFF" bgcolor="#C0C0C0" link="#FFFFFF" alink="#FFFFFF" vlink="#FFFFFF">
<?php
$Datenserver="localhost";
$user="lionhair";
$pass="";
$verbindung = mysql_connect($Datenserver, $user, $pass);
$dbname= "db_local";
$d=mysql_select_db($dbname, $verbindung);
$sql ="SELECT * FROM login";
$ergebnis= mysql_query($sql,$verbindung);
$zeile = mysql_num_rows($ergebnis);

echo"<div align='center'><table width='960' height='20%'>";
echo"<tr>";
 echo"<td>";
 echo"<div align='center'>";
 echo"<table border='1' cellpadding='0' cellspacing='0' bgcolor='#928D89' width='100%' height='100%'>";
echo"<tr>";
 echo"<td>";
 echo"

</p>";
 echo"<div align='center'>

[img]Banner.jpg[/img]</p></div>";

 echo"

</p></td>";
echo"</tr>";
echo"</table>";
 echo"</div>";
 echo"</td>";
 echo"</tr>";
echo"</table></div>";
echo"

";
echo"<table width='100%' height='45%'>";
echo"<tr>";

 echo"<td width='34%'VALIGN='top'>";
  echo"<center><table border='1' cellpadding='0' cellspacing='0' bgcolor='#494949' width='303' height='5%'>";
echo"<tr>";
 echo"<td><div align='center'><u>Login</u></div></td>";
echo"</tr>";
echo"</table>";
echo"<table border='1' cellpadding='0' cellspacing='0' bgcolor='#B4B0AD' width='303' height='15%'>";
  echo"<tr>";
echo"<form action='session.php'   method='post' name='login'>";
echo"<td>Username:</td>";
echo"<td><input type='text' name='user1' size='35'></td>";
echo"</tr>";
echo"<tr>";
echo"<td>Passwort:</td>";
echo"<td><input type='password' name='password1' size='35'></td>";
echo"</tr>";
echo"<tr>";
echo"<td><div align='center'><input type='submit' value='Login' name='loginr'></div></form></td>";
echo"<form action='formular.php'  name='anmelden'>";
echo"<td><div align='center'><input type='submit' value='Anmelden' name='anmeldung'></div></form></form></td>";
 echo"</tr>";
echo"</table>";
echo"

</p>";
 echo"<table border='1' cellpadding='0' cellspacing='0' bgcolor='#494949' width='303' height='5%'>";
echo"<tr>";
 echo"<td><div align='center'><u>Menü</u></div></td>";
echo"</tr>";
echo"</table>";
echo"<table border='1' cellpadding='0' cellspacing='0' bgcolor='#B4B0AD' width='303' height='5%'>";
echo"<tr>";
 echo"<td><div align='center'>Home</div></td>";
echo"</tr>";
echo"</table>";
echo"<table border='1' cellpadding='0' cellspacing='0' bgcolor='#B4B0AD' width='303' height='5%'>";
echo"<tr>";
 echo"<td><div align='center'>Pics</div></td>";
echo"</tr>";
echo"</table>";
echo"<table border='1' cellpadding='0' cellspacing='0' bgcolor='#B4B0AD' width='303' height='5%'>";
echo"<tr>";
 echo"<td><div align='center'>Kontakt</div></td>";
echo"</tr>";
echo"</table></center>";
 echo"</td>";
 echo"<td  VALIGN='top'>";
echo"<form action=\"auswertung.php\" method='post'>";
echo"<center>";
echo"<table border='1' cellpadding='0' cellspacing='0' bgcolor='#494949' width='490' height='5%'>";
echo"<tr >";
 echo"<td><div align='center'><u>Anmeldung</u></div></td>";
echo"</tr>";
echo"</table>";
echo"<table border=\"1\" cellpadding=\"0\" cellspacing=\"0\" bgcolor='#B4B0AD' width='490' height='80%'>";
echo"<tr>";
echo"<td>Username :$Username</td>";
echo"</tr>";
echo"<tr>";
echo"<td>Vorname :$Vorname</td>";
echo"</tr>";
echo"<tr>";
echo"<td>Nachname :$Nachname</td>";
echo"</tr>";
echo"<tr>";
echo"<td>Straße :$Straße</td>";
echo"</tr>";
echo"<tr>";
echo"<td>PLZ :$PLZ</td>";
echo"</tr>";
echo"<tr>";
echo"<td>Ort :$Ort</td>";
echo"</tr>";
echo"<tr>";
echo"<td>E-Mail Adresse :$Mail</td>";
echo"</tr>";
echo"<tr>";
echo"<td>Passwort :$Passwort</div></td>";
echo"</tr>";
echo"</table>";

mysql_query("CREATE TABLE $Username (
  user VARCHAR(10) NOT NULL PRIMARY KEY,
  password VARCHAR(28) NOT NULL,
  session VARCHAR(28)
 )");

$eintrag="INSERT INTO $Username (user, password, session) VALUES ('$Username', '$Passwort', NULL)";
$eintragen= mysql_query($eintrag);

$eintrag2 = "INSERT INTO login (Username, Vorname, Nachname, Straße, PLZ, Ort, Mail, Passwort) VALUES ('$Username', '$Vorname', '$Nachname', '$Straße', '$PLZ', '$Ort', '$Mail', '$Passwort')";
$eintragen2 = mysql_query($eintrag2);
echo"<table>";
echo"<tr>";
echo"<td>";
echo"<form action='formular.php'>";
   echo"<div align=\"center\"><input type=\"submit\" value=\"Angaben ändern\"></form></td>";
   echo"

";
   echo"</p>";
echo"<td><form action=\"bestaetigung.php\">";
   echo"<div align=\"center\"><input type=\"submit\" Value=\"Anmelden\"></form></td>";
   echo"</tr>";
   echo"</table>";
echo"</td>";
 echo"</tr>";
echo"</table>";

echo"</p>";
?>
</body>
</html>
Danke schon mal im Voraus.

MFG Mamagotchi
 
Sponsor Mitteilung
PHP Code Flüsterer

Registriert seit: 21.08.2005
Beiträge: 4682
PHP-Kenntnisse:
Fortgeschritten

Alt 17.11.2004, 20:33  
Gast
 
Beiträge: n/a
Standard

also bei einem form-tag fehlt method...


http://de.php.net/register_globals
du musst die Superglobals $_POST, $_GET etc. benutzen
 
Alt 17.11.2004, 20:53  
Gast
 
Beiträge: n/a
Standard

da steht doch method='post' wo es nötig ist. dat komische ist dat bei meiner alten seite (http://mitglied.lycos.de/aol2004/die Anmeldung funzt und ich hab sie nur angepasst (die scripts).
 
Alt 17.11.2004, 20:56  
Gast
 
Beiträge: n/a
Standard

du gehts wohl nie auf diese blau hinterlegten, Schriftzüge die sich in der Fachsprache auch Hyperlinks nennen?

zu deiner anderen behauptung:

Zitat:
Zitat von dein script
echo"<form action='formular.php' name='anmelden'>";
naja du hast da ja mind. 3 form-tags ich nehmen mal an, dass das eigentlich problem mit register globals zusammen hängt..

wie gesagt: diese blauen dinger, die sich hyperlinks nennen können ganz praktisch sein
 
Alt 17.11.2004, 20:59  
Gast
 
Beiträge: n/a
Standard

du wohl auch nicht. schon mal meine alte Seite http://mitglied.lycos.de/aol2004/ gewesen ??? Da funzt der script und ich hab es nur an mein neues "design" ( ich weiß das es scheiße aussieht) angepasst.
 
Alt 17.11.2004, 21:00  
Gast
 
Beiträge: n/a
Standard

poste bitte mal ein link zu deiner phpinfo()
 
Alt 17.11.2004, 21:03  
Gast
 
Beiträge: n/a
Standard

phpinfo () ??? willst du die jetzt von meinem localhost haben oder wat ??? Ey ich bin Anfänger !!! Nur erklärte Fachausdrücke bitte ^^
 
Alt 17.11.2004, 21:03  
Gast
 
Beiträge: n/a
Standard

zeile 45 bis ein paar danach:

PHP-Code:
echo"<form action='session.php'   method='post' name='login'>"
echo
"<td>Username:</td>"
echo
"<td><input type='text' name='user1' size='35'></td>"
echo
"</tr>"
echo
"<tr>"
echo
"<td>Passwort:</td>"
echo
"<td><input type='password' name='password1' size='35'></td>"
echo
"</tr>"
echo
"<tr>"
echo
"<td><div align='center'><input type='submit' value='Login' name='loginr'></div></form></td>"
echo
"<form action='formular.php'  name='anmelden'>"
du öffnest ein formular, was du an SESSIONS.PHP sendest(deine logindaten) und dieses formular schließte net ma.
wenn ich das richtig überflogen habe, hast du allgemein 4 formulare in der ersten datei geöffnet, aber nur 2 geschloßen. und so nebenbei:
du kannst den php teil auch oben wieder schließen nachdem du die vars dort definiert hast. is übersichtlicher. weil ich glaub die, brauchst in dem teil net weiter. bidde berichtigt mich wenn es anders is. aber den code kann man echt nur überfliegen und net komplett analysieren.

smilli
 
Alt 17.11.2004, 21:07  
Gast
 
Beiträge: n/a
Standard

Zitat:
Zitat von Smilerr
aber den code kann man echt nur überfliegen und net komplett analysieren.
ich weigere mich schon ihn zu überfliegen...

aber es gab schon 100 mal die frage:
Zitat:
mein formularscript funktioniert nicht mehr.
auf meiner alten page hat es funktioniert aber jetzt nicht mehr.
der fehler liegt immer darin, dass die scripte auf register globals=on basieren

naja die phpinfo() wird aufschluss bringen...
 
Alt 17.11.2004, 21:07  
Gast
 
Beiträge: n/a
Standard

Da is doch noch hinten </form> rangehangen, oder muss ich extra echo "<form>"; schreiben ???
 
 


Themen-Optionen
Thema bewerten
Thema bewerten:

Forumregeln
Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are an
Gehe zu

Ähnliche Themen
Thema Autor Forum Antworten Letzter Beitrag
[Erledigt] Statistik Script Referrer Problem 7Style PHP Tipps 2008 28 01.07.2008 15:14
Problem mit php script Jelko PHP Tipps 2008 2 19.08.2007 23:28
Problem bei Dateidownload via PHP Script niffi PHP-Fortgeschrittene 7 01.06.2007 19:39
Problem mit einem Script wo ich ned weiterkomme MatthiasNI PHP Tipps 2006 3 14.10.2006 17:35
Problem mit einem Script PHP Tipps 2007 7 28.11.2005 16:37
Problem mit Login Script PHP Tipps 2007 4 15.11.2005 17:29
mal funktionierts, mal nicht - großes Problem mit PHP Script nicobischof PHP Tipps 2005-2 5 01.10.2005 16:13
Problem mit Bilder einfügen Script PHP Tipps 2005-2 3 21.07.2005 00:28
problem mit login script PHP Tipps 2005 26 20.05.2005 22:10
[Erledigt] PHP Script Problem PHP Tipps 2005 12 06.01.2005 12:38
Problem mit einem Bildergallery Script (Strato Problem???) sharky PHP Tipps 2007 9 05.01.2005 11:00
Termin Script Problem PHP Tipps 2004 16 16.08.2004 08:35
Problem beim Upload mehrerer Dateien per Script PHP Tipps 2004 1 04.08.2004 16:26
Script Problem: parse error unexpected $end PHP Tipps 2004 5 02.08.2004 13:25
delete script problem PHP Tipps 2004 5 23.07.2004 14:39


Alle Zeitangaben in WEZ +2. Es ist jetzt 23:39 Uhr.




Powered by vBulletin® Version 3.7.2 (Deutsch)
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
Aprilia-Forum, Aquaristik-Forum, Liebeskummer-Forum, Zierfisch-Forum, Geizkragen-Forum

Creative Commons License
Dieser Inhalt ist unter einer Creative Commons-Lizenz lizenziert.