phpbuddy.eu
-


Hinweise


Antwort
 
LinkBack Themen-Optionen Thema durchsuchen Thema bewerten
Alt 16.12.2003, 14:51   #1
TP-Member
 
Registriert seit: Dec 2003
pierre macht alles soweit korrekt

nach passwort eingabe die dazugehörige adresse anzeigen


hallo

ich wollte im dreamweaver ein passwortseite erstellen funktioniert auch mit der abfrage. das problem is ich wollte ,wenn passwort und email richtig ist auf der näschte seite die schon in der datenbank eingetragene anschrift (adresse) anzeigt.
wie kann man bei dreamweaver das machen?



hier der script von der passwortseite:

PHP-Code:
<?php require_once('Connections/eshop.php'); ?>
<?php
$colname_Recordset1 
"1";
if (isset(
$_POST['email'])) {
  
$colname_Recordset1 = (get_magic_quotes_gpc()) ? $_POST['email'] : addslashes($_POST['email']);
}
mysql_select_db($database_eshop$eshop);
$query_Recordset1 sprintf("SELECT * FROM adresse WHERE email = '%s'"$colname_Recordset1);
$Recordset1 mysql_query($query_Recordset1$eshop) or die(mysql_error());
$row_Recordset1 mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 mysql_num_rows($Recordset1);

$colname_passwort "1";
if (isset(
$_POST['email'])) {
  
$colname_passwort = (get_magic_quotes_gpc()) ? $_POST['email'] : addslashes($_POST['email']);
}
mysql_select_db($database_eshop$eshop);
$query_passwort sprintf("SELECT * FROM adresse WHERE email = '%s'"$colname_passwort);
$passwort mysql_query($query_passwort$eshop) or die(mysql_error());
$row_passwort mysql_fetch_assoc($passwort);
$totalRows_passwort mysql_num_rows($passwort);


function 
GetSQLValueString($theValue$theType$theDefinedValue ""$theNotDefinedValue ""
{
  
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;

  switch (
$theType) {
    case 
"text":
      
$theValue = ($theValue != "") ? "'" $theValue "'" "NULL";
      break;    
    case 
"long":
    case 
"int":
      
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case 
"double":
      
$theValue = ($theValue != "") ? "'" doubleval($theValue) . "'" "NULL";
      break;
    case 
"date":
      
$theValue = ($theValue != "") ? "'" $theValue "'" "NULL";
      break;
    case 
"defined":
      
$theValue = ($theValue != "") ? $theDefinedValue $theNotDefinedValue;
      break;
  }
  return 
$theValue;
}

$editFormAction $_SERVER['PHP_SELF'];
if (isset(
$_SERVER['QUERY_STRING'])) {
  
$editFormAction .= "?" htmlentities($_SERVER['QUERY_STRING']);
}
     
if ((isset(
$_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
  
$insertSQL sprintf("INSERT INTO adresse (anrede, vorname, name, strasse, plz, ort, land, telefon, fax, email, bank, konto_nr, blz, bemerkung, passwort) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
                       
GetSQLValueString($_POST['anrede'], "text"),
                       
GetSQLValueString($_POST['vorname'], "text"),
                       
GetSQLValueString($_POST['name'], "text"),
                       
GetSQLValueString($_POST['strasse'], "text"),
                       
GetSQLValueString($_POST['plz'], "text"),
                       
GetSQLValueString($_POST['ort'], "text"),
                       
GetSQLValueString($_POST['land'], "text"),
                       
GetSQLValueString($_POST['telefon'], "text"),
                       
GetSQLValueString($_POST['fax'], "text"),
                       
GetSQLValueString($_POST['email'], "text"),
                       
GetSQLValueString($_POST['bank'], "text"),
                       
GetSQLValueString($_POST['konto_nr'], "text"),
                       
GetSQLValueString($_POST['blz'], "text"),
                       
GetSQLValueString($_POST['bemerkung'], "text"),
                       
GetSQLValueString($_POST['passwort'], "text"));

  
mysql_select_db($database_eshop$eshop);
  
$Result1 mysql_query($insertSQL$eshop) or die(mysql_error());
setcookie($email"email");
  
$insertGoTo "bestellung.php";
  if (isset(
$_SERVER['QUERY_STRING'])) {
    
$insertGoTo .= (strpos($insertGoTo'?')) ? "&" "?";
    
$insertGoTo .= $_SERVER['QUERY_STRING'];
  }
  
header(sprintf("Location: %s"$insertGoTo));
}
?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Unbenanntes Dokument</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.Stil1 {
    color: #FFFFFF;
    font-weight: bold;
}
-->
</style>
<script language="JavaScript" type="text/JavaScript">
<!--

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('The following error(s) occurred:\n'+errors);
  document.MM_returnValue = (errors == '');
}

function MM_setTextOfTextfield(objName,x,newText) { //v3.0
  var obj = MM_findObj(objName); if (obj) obj.value = newText;
}
//-->
</script>
</head>

<body>
<form method="POST" name="kunde" id="kunde">
  <table width="100%"  border="1">
    <tr>
      <td width="13%"><p>email:</p>      </td>
      <td width="87%"><input name="email" type="text" id="email"></td>
    </tr>
    <tr>
      <td>Passwort:</td>
      <td><input name="passwort" type="text" id="passwort"></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td><input name="abswenden" type="submit" id="abswenden" value="Absenden"></td>
    </tr>
  </table>
</form>
<p>&nbsp;</p>
<form action="test.php" name="form1" method="post">

  <table  border="0" bordercolor="#FFFFFF" id="form">
    <tr bgcolor="#0000CC">
      <td width="133"><div align="center" class="Stil1">Adresse:</div></td>
      <td width="325">&nbsp;</td>
    </tr>
    <tr>
      <td><div align="right">Anrede:</div></td>
      <td><input name="anrede" type="text" id="anrede" value="<?php echo $row_Recordset1['anrede']; ?>"></td>
    </tr>
    <tr>
      <td><div align="right">Vorname:</div></td>
      <td><input name="vorname" type="text" value="<?php echo $row_Recordset1['vorname']; ?>"></td>
    </tr>
    <tr>
      <td><div align="right">Nachname:</div></td>
      <td><input name="name" type="text" id="name" value="<?php echo $row_Recordset1['name']; ?>"></td>
    </tr>
    <tr>
      <td nowrap><div align="right">Strasse u. Nr: </div></td>
      <td><input name="strasse" type="text" id="strasse" value="<?php echo $row_Recordset1['strasse']; ?>"></td>
    </tr>
    <tr>
      <td><div align="right">Plz::</div></td>
      <td><input name="plz" type="text" id="plz" value="<?php echo $row_Recordset1['plz']; ?>" size="5" maxlength="5"></td>
    </tr>
    <tr>
      <td><div align="right">Ort:</div></td>
      <td><input name="ort" type="text" id="ort" value="<?php echo $row_Recordset1['ort']; ?>"></td>
    </tr>
    <tr>
      <td><div align="right">Land:</div></td>
      <td><input name="land" type="text" id="land" value="<?php echo $row_Recordset1['land']; ?>"></td>
    </tr>
    <tr>
      <td><div align="right">Telefon:</div></td>
      <td><input name="telefon" type="text" id="telefon" value="<?php echo $row_Recordset1['telefon']; ?>"></td>
    </tr>
    <tr>
      <td><div align="right">Telefax:</div></td>
      <td><input name="fax" type="text" id="fax" value="<?php echo $row_Recordset1['fax']; ?>"></td>
    </tr>
    <tr>
      <td><div align="right">Email:</div></td>
      <td><input name="email" type="text" id="email" value="<?php echo $_POST['email']; ?>"></td>
    </tr>
    <tr>
      <td><div align="right">Passwort:</div></td>
      <td><input name="passwort" type="password" id="passwort"></td>
    </tr>
    <tr>
      <td nowrap><div align="right">Psswort wiederholen: </div></td>
      <td><input name="passwort2" type="password" id="passwort"></td>
    </tr>
    <tr>
      <td><div align="right"></div></td>
      <td>&nbsp;</td>
    </tr>
    <tr bgcolor="#0000CC">
      <td><div align="center" class="Stil1">Zahlung:</div></td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td><div align="right"></div></td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td><div align="right">Bank:</div></td>
      <td><input name="bank" type="text" id="bank" value="<?php echo $row_Recordset1['bank']; ?>"></td>
    </tr>
    <tr>
      <td><div align="right">Blz:</div></td>
      <td><input name="blz" type="text" id="blz" value="<?php echo $row_Recordset1['blz']; ?>"></td>
    </tr>
    <tr>
      <td><div align="right">Konto-Nr.:</div></td>
      <td><input name="konto_nr" type="text" id="konto_nr" value="<?php echo $row_Recordset1['konto_nr']; ?>">      </td>
    </tr>
    <tr>
      <td valign="top"><div align="right">Bemerkung:</div></td>
      <td><textarea name="bemerkung" cols="50" rows="8" id="bemerkung"></textarea></td>
    </tr>
  </table>
    
    
  <p>
    <input type="hidden" name="MM_insert" value="form1">
    
  </p>
  <table  border="0">
    <tr>
      <td width="11%">&nbsp;</td>
      <td width="89%" nowrap><input name="checkbox" type="checkbox" class="Stil1" id="checkbox" value="on" size="2">      
      Die Allgemeinen <a href="shop_condition.php?VID=5VwdkRETS8cVUNGR">Gesch&auml;ftsbedingungen </a> habe ich gelesen und erkenne sie hiermit an. </td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td> <input name="eingabe" type="submit" id="eingabe" onClick="MM_validateForm('vorname','','R','name','','R','strasse','','R','plz','','RisNum','ort','','R','telefon','','NisNum','fax','','NisNum','email','','NisEmail','bank','','R','blz','','NisNum','konto_nr','','NisNum','0','','R','1','','R');return document.MM_returnValue" value="Eingabe">
        <input type="reset" name="Submit2" value="Zurücksetzen"></td>
    </tr>
  </table>
  <p>&nbsp;  </p>
</form>
</body>
</html>
<?php
mysql_free_result
($Recordset1);

mysql_free_result($passwort);
?>
pierre ist offline   Mit Zitat antworten


Alt 19.12.2003, 10:26   #2
Registered User
 
Benutzerbild von cartman2710
 
Registriert seit: Oct 2003
Ort: Ennepetal
cartman2710 macht alles soweit korrekt
Hi,

ich glaube, das ist schon mehrfach in diesem forum beantwortet worden. die suche hilft da weiter.

Man muss doch einfach nur checken, ob der user mit passwot in der tabelle vorhanden ist, und die benötigten datensätze auslesen.

Lösung:

$sql="SELECT * FROM tabelle WHERE user = '$email' AND pass ='$passwort'";
$result=mysql_db_query($db, $sql);
if(mysql_num_rows($result) > 0)
{
// Datensatz holen
$row = mysql_fetch_array($result);
//Ausgabe
echo $row[adresse];
}
else
{
echo "error!";
}


bitte in zukunft solch lange scripte nur als attachment
cartman2710 ist offline   Mit Zitat antworten
Antwort

  Aktuelles Thema
  TP Hilfe Forum > Web-Editoren & Coding > Traum-Dynamik
nach passwort eingabe die dazugehörige adresse anzeigen nach passwort eingabe die dazugehörige adresse anzeigen
« newsticker durch text file aktualisieren | Variablen Übergabe »

Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1)
 
Themen-Optionen Thema durchsuchen
Thema durchsuchen:

Erweiterte Suche
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


Alle Zeitangaben in WEZ +2. Es ist jetzt 05:46 Uhr.

Powered by: vBulletin Version 3.7 (Deutsch)
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd. / Search Engine Friendly URLs by vBSEO 3.2.0 ©2008, Crawlability, Inc.
Traum-Projekt.com | Suchen | Archiv | Impressum | Kontakt | | | Nach oben |



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67