ERLEDIGT
JA
JA
ANTWORTEN
6
6
ZUGRIFFE
271
271
EMPFEHLEN
-
Ich komme da zu keinem Resultat.
Ich habe genau die gleiche methode für eine andere Überprüfung benutzt und da geht es.?
Vielleicht seht Ihr etwas was ich nicht Sehe.PHP-Code:<div id="titel">Benutzerverwaltung</div>
<?
if(isset($_POST['passaction']))
{
$setpass = 1;
if(empty($_POST['pass']))
{
$setpass = 0;
$error = 'Bitte Passwort eingeben.';
}
if(empty($_POST['passbes']))
{
$setpass = 0;
$error = 'Bitte wiederholen.';
}
if($_POST['pass'] == $_POST['passbes'])
{
$setpass = 1;
}else{
$setpass = 0;
$error = 'Keine übereinstimmung.';
}
}
if($setpass)
{
$query = '
UPDATE
`benutzerdaten`
SET
`pass` = "'.mysql_real_escape_string($_POST['pass']).'"
WHERE
`value` = "'.$value.'"
';
mysql_query($query);
?>
<div id="content"><b>Passwort erfolgreich geändert!</b><br><hr noshade color="#CC6600" size="1" style="width: 540px;">
<form action="<? echo $_SERVER['PHP_SELF']; ?>?ssl=acpass&show=user" method="post">
<input type="hidden" name="passaction" value="1">
<table id="csxfelgen">
<tr>
<td style="width: 200px;">Neues Passwort:</td><td style="width: 300px;"><input type="text" name="pass" class="csx"></td>
</tr>
<tr>
<td style="width: 200px;">Passwort bestätigen:</td><td style="width: 300px;"><input type="text" name="passbes" class="csx"></td>
</tr>
<tr>
<td colspan="2"><input type="submit" name="send" value="speichern" class="csx"></td>
</tr>
</table>
</form>
<hr noshade color="#CC6600" size="1" style="width: 540px;">
</div>
<? }else{ ?>
<div id="content"><b>Passwort ändern</b><br><hr noshade color="#CC6600" size="1" style="width: 540px;">
<form action="<? echo $_SERVER['PHP_SELF']; ?>?ssl=acpass&show=user" method="post">
<input type="hidden" name="passaction" value="1">
<table id="csxfelgen">
<tr>
<td style="width: 200px;">Neues Passwort:</td><td style="width: 300px;"><input type="text" name="pass" class="csx"><? echo $error; ?></td>
</tr>
<tr>
<td style="width: 200px;">Passwort bestätigen:</td><td style="width: 300px;"><input type="text" name="passbes" class="csx"></td>
</tr>
<tr>
<td colspan="2"><input type="submit" name="send" value="speichern" class="csx"></td>
</tr>
</table>
</form>
<hr noshade color="#CC6600" size="1" style="width: 540px;">
</div>
<? } ?>
Danke
-
Was genau funktioniert denn nicht?
-
Es wird "nichts" eingetragen wen die Passwort felder Leer sind.
Es sollte doch die Fehlermeldung kommen das nichts in dem Feld Passwort steht.
-
Ich bin drauf gekommen.
Es ging nur um die Richtige reienfolge der abfragen.PHP-Code:if(isset($_POST['passaction']))
{
$setpass = 1;
if(empty($_POST['pass']))
{
$setpass = 0;
$error = ' Bitte Passwort eingeben.';
}else{
$setpass = 1;
if(empty($_POST['passbes']))
{
$setpass = 0;
$error1 = ' und korrekt wiederholen.';
$error = ' Bitte Passwort erneut eingeben.';
}else{
$setpass = 1;
if($_POST['pass'] == $_POST['passbes'])
{
$setpass = 1;
}else{
$setpass = 0;
$error = ' Keine übereinstimmung,';
$error1 = ' versuchen sie es erneut.';
}
}
}
}
if($setpass)
-
Das letzt esle kannst du dir auch sparen, amch doch einfach !=
Code Climbers
- Free Scripts & Codes
-
Danke, auf das ! wäre ich ned gekommen.
-
Warum benutzt Du zwei Formulare, wenn das doch alles mit nur einem geht?
PHP-Code:<?php
error_reporting(E_ALL);
$erfolg = '';
$meldung = '';
if(isset($_POST['send'])){
if(empty($_POST['pass'])){
$meldung = 'Bitte Passwort eingeben.<br/>';
}
if(empty($_POST['passbes'])){
$meldung = $meldung.'Bitte Eingabe wiederholen.<br/>';
}
if($_POST['pass'] != $_POST['passbes']){
$meldung = $meldung.'Keine übereinstimmung.<br/>';
}
}
if(!empty($_POST['pass']) && !empty($_POST['passbes']) && $_POST['pass'] == $_POST['passbes']){
$erfolg = 'Passwort erfolgreich geändert!';
$query = 'UPDATE
`benutzerdaten`
SET
`pass` = "'.mysql_real_escape_string($_POST['pass']).'"
WHERE
`value` = "'.$value.'"
';
mysql_query($query);
}
?>HTML-Code:<div id="content"><b><?php echo $erfolg ?></b><br> <hr noshade color="#CC6600" size="1" style="width: 540px;"> <form action="<? echo $_SERVER['PHP_SELF']; ?>?ssl=acpass&show=user" method="post"> <table id="csxfelgen"> <tr> <td style="width: 200px;">Neues Passwort:</td><td style="width: 300px;"> <input type="password" name="pass" class="csx"></td> </tr> <tr> <td style="width: 200px;">Passwort bestätigen:</td><td style="width: 300px;"> <input type="password" name="passbes" class="csx"></td> </tr> <tr> <td colspan="2"><input type="submit" name="send" value="speichern" class="csx"></td> </tr> <tr> <td> </td><td><?php echo $meldung ?></td> </tr> </table> </form> <hr noshade color="#CC6600" size="1" style="width: 540px;"> </div>
Ähnliche Themen
-
Überprüfung, ob JPasswordField Inhalt hat, funktioniert nicht
Von Tinipieps im Forum JavaAntworten: 4Letzter Beitrag: 14.04.10, 10:04 -
Überprüfung ob es id gibt, funktioniert nicht!
Von harderph im Forum PHPAntworten: 4Letzter Beitrag: 17.01.08, 20:26 -
Com Port Überprüfung funktioniert nicht richtig
Von sucher im Forum C/C++Antworten: 4Letzter Beitrag: 27.02.06, 18:00 -
Überprüfung ob Datensatz schon vorhanden funktioniert nicht
Von Gifty43 im Forum PHPAntworten: 4Letzter Beitrag: 28.08.05, 18:41 -
Aufklappmenü funktioniert im FF nicht WIESO?
Von CikoNo1 im Forum Javascript & AjaxAntworten: 4Letzter Beitrag: 02.08.05, 15:28





Zitieren
Login






[PHP][Snippet] Array zu XML konvertieren