Zur Navigation

captcha session einbinden

1 andehrl

hallo,
ich würde gerne der registration meiner site ein captcha zufügen. hab auch ein entsprechendes script gefunden. das bild wird erstellt und das entsprechende eingabefeld habe ich auch eingefügt.

<tr>
          <td align="right">&nbsp;</td>
          <td height="33" align="right">&nbsp;</td>
          <td>&nbsp;</td>
          <td height="24" colspan="2" align="left" valign="middle"><img src="captcha/captcha.php" border="0" title="Sicherheitscode"></td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td align="right">&nbsp;</td>
          <td height="33" align="right">&nbsp;</td>
          <td>&nbsp;</td>
          <td height="24" colspan="2" align="left" valign="middle"><input type="text" name="sicherheitscode" size="19"></td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>

mir ist jetzt nicht klar wie ich den ausführenden teil in mein script einfügen muss. meine versuche sind bisher gescheitert. der ausführende code schaut so aus:

<?php
session_start();
if(isset($_SESSION['captcha_spam']) AND $_POST["sicherheitscode"] == $_SESSION['captcha_spam']){
unset($_SESSION['captcha_spam']);

}else{
   die ("Der Sicherheitscode ist falsch!");
} 
?>

mein script sieht so aus:

<?php require_once('Connections/Registrierung.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($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"] == "einfache registrierung")) {
$error = '';
mysql_select_db($database_Registrierung, $Registrierung);
$result = mysql_query("SELECT nutzername FROM login WHERE nutzername = '" . mysql_real_escape_string($_POST['nutzername']) . "'");
if (mysql_num_rows($result) > 0) {
    $error = 'Dieser Nutzername ist bereits vergeben. Bitte versuchen Sie es mit einem anderen Namen.';
} else {
    $result = mysql_query("SELECT mail FROM login WHERE mail = '" . mysql_real_escape_string($_POST['mail']) . "'");
    if (mysql_num_rows($result) > 0) {
        $error = 'Diese Emailadresse ist bereits vergeben. Bitte versuchen Sie es mit einer anderen E-Mail.';
    }
	echo mysql_error();
}
echo mysql_error();

if ($error == "") {
    $insertSQL = sprintf("INSERT INTO login (vornachname, nutzername, passwort, mail, handy) VALUES (%s, %s, %s, %s, %s)",
                       GetSQLValueString($_POST['vornachname'], "text"),
                       GetSQLValueString($_POST['nutzername'], "text"),
                       GetSQLValueString($_POST['passwort'], "text"),
                       GetSQLValueString($_POST['mail'], "text"),
                       GetSQLValueString($_POST['handy'], "text"));
  
  $Result1 = mysql_query($insertSQL, $Registrierung) or die(mysql_error());

  $insertGoTo = "8cSieSindEingeloggt.php";
  if (isset($_SERVER['QUERY_STRING'])) {
    $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
    $insertGoTo .= $_SERVER['QUERY_STRING'];
  }
  header(sprintf("Location: %s", $insertGoTo));
}
}

?>
<?php
// *** Validate request to login to this site.
if (!isset($_SESSION)) {
  session_start();
}

$loginFormAction = $_SERVER['PHP_SELF'];
if (isset($_GET['accesscheck'])) {
  $_SESSION['PrevUrl'] = $_GET['accesscheck'];
}

if (isset($_POST['nutzername']) && empty($error)) {
  $loginUsername=$_POST['nutzername'];
  $password=$_POST['passwort'];
  $MM_fldUserAuthorization = "";
  $MM_redirectLoginSuccess = "8cSieSindEingeloggt.php";
  $MM_redirectLoginFailed = "8bMeinkontologinfehlgeschlagen.php";
  $MM_redirecttoReferrer = true;
  mysql_select_db($database_Registrierung, $Registrierung);
  
  $LoginRS__query=sprintf("SELECT nutzername, passwort FROM login WHERE nutzername=%s AND passwort=%s",
    GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text")); 
   
  $LoginRS = mysql_query($LoginRS__query, $Registrierung) or die(mysql_error());
  $loginFoundUser = mysql_num_rows($LoginRS);
  if ($loginFoundUser) {
     $loginStrGroup = "";
    
    //declare two session variables and assign them
    $_SESSION['MM_Username'] = $loginUsername;
    $_SESSION['MM_UserGroup'] = $loginStrGroup;	      

    if (isset($_SESSION['PrevUrl']) && true) {
      $MM_redirectLoginSuccess = $_SESSION['PrevUrl'];	
    }
    header("Location: " . $MM_redirectLoginSuccess );
  }
  else {
    header("Location: ". $MM_redirectLoginFailed );
  }
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>mit-umzug-gelegenheit.de</title>
<script src="SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
<script src="SpryAssets/SpryValidationConfirm.js" type="text/javascript"></script>
<script type="text/JavaScript">
<!--
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

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_nbGroup(event, grpName) { //v6.0
  var i,img,nbArr,args=MM_nbGroup.arguments;
  if (event == "init" && args.length > 2) {
    if ((img = MM_findObj(args[2])) != null && !img.MM_init) {
      img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;
      if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array();
      nbArr[nbArr.length] = img;
      for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
        if (!img.MM_up) img.MM_up = img.src;
        img.src = img.MM_dn = args[i+1];
        nbArr[nbArr.length] = img;
    } }
  } else if (event == "over") {
    document.MM_nbOver = nbArr = new Array();
    for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = (img.MM_dn && args[i+2]) ? args[i+2] : ((args[i+1])? args[i+1] : img.MM_up);
      nbArr[nbArr.length] = img;
    }
  } else if (event == "out" ) {
    for (i=0; i < document.MM_nbOver.length; i++) {
      img = document.MM_nbOver[i]; img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; }
  } else if (event == "down") {
    nbArr = document[grpName];
    if (nbArr)
      for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src = img.MM_up; img.MM_dn = 0; }
    document[grpName] = nbArr = new Array();
    for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = img.MM_dn = (args[i+1])? args[i+1] : img.MM_up;
      nbArr[nbArr.length] = img;
  } }
}
//-->
</script>
<style type="text/css">
<!--
@import url("schriftangaben1111111111.css");
body {
	margin-top: 50px;
}
.Stil20 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; font-weight: bold; }
.Schriftangaben {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 10px;
	font-weight: bold;
	background-position: right center;
}
.Stil22 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold; background-position: right center; }
.Schriftstil {	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 10px;
	font-weight: bold;
}
#Layer1 {
	position:absolute;
	left:2px;
	top:1px;
	width:100%;
	height:100%;
	z-index:1;
	visibility: hidden;
}
-->
</style>
<script type="text/javascript">
<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
<link href="Seiten/Seiten/Stylesheet Formular.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.Stil23 {color: #FFFFFF}
.Stil24 {color: #000000}
.Stil28 {font-size: 14px;
	color: #000000;
}
-->
</style>
<link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" />
<link href="SpryAssets/SpryValidationConfirm.css" rel="stylesheet" type="text/css" />
</head>

<body onload="MM_preloadImages('Bilder/Home 3.png','Bilder/Home 2.png','Bilder/Home 4.png','Bilder/Mit-Umzug-Angebote 3.png','Bilder/Mit-Umzug-Angebote 4.png','Bilder/Eingabe 3.png','Bilder/Eingabe 2.png','Bilder/Eingabe 4.png','Bilder/MeinKonto 3.png','Bilder/MeinKonto 4.png','Bilder/Hilfe 3.png','Bilder/Hilfe 2.png','Bilder/Hilfe 4.png','Bilder/Mit-Umzug-Angebote 2.png')" tracingsrc="1home.php" tracingopacity="100" tracingx="0" tracingy="3458793">
<div id="Layer1"></div>
<table width="859" border="0" cellspacing="0">
  <!--DWLayoutTable-->
  <tr>
    <td width="131">&nbsp;</td>
    <td width="131">&nbsp;</td>
    <td width="131">&nbsp;</td>
    <td width="337" align="right" valign="bottom" class="Schriftangaben"><a href="9Impressum.php" class="schriftangaben11111111111">impressum</a></td>
    <td width="79" align="right" valign="bottom" class="Schriftangaben"><a href="99aRegistrierungEinfach.php" class="schriftangaben11111111111">registrierung</a></td>
    <td width="38" align="right" valign="bottom" class="Schriftangaben"><a href="8aMeinkontologin.php" class="schriftangaben11111111111">login</a></td>
  </tr>
</table>
<table width="1200" border="0" cellpadding="0" cellspacing="0">
  <!--DWLayoutTable-->
  <tr>
    <td width="54" height="160" valign="top"><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td colspan="2" valign="top"><img src="Bilder/Mit-Umzug-Gelegenheit Hauptbild.png" alt="mit-umzug-gelegenheit.de" width="805" height="160" vspace="5" border="0" usemap="#Map" /></td>
    <td width="89" valign="bottom">&nbsp;</td>
    <td width="252"></td>
  </tr>
  
  <tr>
    <td height="2"></td>
    <td width="524"></td>
    <td width="281"></td>
    <td></td>
    <td></td>
  </tr>
  <tr>
    <td height="106"></td>
    <td colspan="3" valign="top"><table border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td><a href="1home.php" target="_top" onclick="MM_nbGroup('down','group1','Home1','Bilder/Home 3.png',1)" onmouseover="MM_nbGroup('over','Home1','Bilder/Home 2.png','Bilder/Home 4.png',1)" onmouseout="MM_nbGroup('out')"><img src="Bilder/Home 1.png" alt="home" name="Home1" border="0" id="Home1" onload="" /></a></td>
        <td><a href="AngeboteoderGesucheSuchen.php" target="_top" onclick="MM_nbGroup('down','group1','MitUmzugAngebote1','Bilder/Mit-Umzug-Angebote 3.png',1)" onmouseover="MM_nbGroup('over','MitUmzugAngebote1','Bilder/Mit-Umzug-Angebote 2.png','Bilder/Mit-Umzug-Angebote 4.png',1)" onmouseout="MM_nbGroup('out')"><img src="Bilder/Mit-Umzug-Angebote 1.png" alt="suche" name="MitUmzugAngebote1" hspace="5" border="0" id="MitUmzugAngebote1" onload="" /></a></td>
        <td><a href="8aMeinkontologin.php" target="_top" onclick="MM_nbGroup('down','group1','Eingabe1','Bilder/Eingabe 3.png',1)" onmouseover="MM_nbGroup('over','Eingabe1','Bilder/Eingabe 2.png','Bilder/Eingabe 4.png',1)" onmouseout="MM_nbGroup('out')"><img src="Bilder/Eingabe 1.png" alt="eingabe" name="Eingabe1" hspace="5" border="0" id="Eingabe1" onload="" /></a></td>
        <td><a href="8aMeinkontologin.php" target="_top" onclick="MM_nbGroup('down','group1','MeinKonto1','Bilder/MeinKonto 3.png',1)" onmouseover="MM_nbGroup('over','MeinKonto1','Bilder/MeinKonto 4.png','Bilder/MeinKonto 4.png',1)" onmouseout="MM_nbGroup('out')"><img src="Bilder/MeinKonto 3.png" alt="mein konto" name="MeinKonto1" hspace="5" border="0" id="MeinKonto1" onload="" /></a></td>
        <td><a href="7hilfe.php" target="_top" onclick="MM_nbGroup('down','group1','Hilfe1','Bilder/Hilfe 3.png',1)" onmouseover="MM_nbGroup('over','Hilfe1','Bilder/Hilfe 2.png','Bilder/Hilfe 4.png',1)" onmouseout="MM_nbGroup('out')"><img src="Bilder/Hilfe 1.png" alt="hilfe" name="Hilfe1" border="0" id="Hilfe1" onload="" /></a></td>
      </tr>
    </table></td>
    <td></td>
  </tr>
  <tr>
    <td height="19"></td>
    <td height="13" align="right" valign="middle" class="schriftangaben11111111111"><a href="99bRegistrierungErweitert.php" class="schriftangaben11111111111">erweiterte registrierung</a></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td></td>
  </tr>
  <tr>
    <td height="103"></td>
    <td valign="top"><img src="Bilder/Registrieren Kopf.png" alt="registrieren" width="524" height="96" /></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td></td>
  </tr>
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  <tr>
    <td height="416"></td>
    <td align="left" valign="top"><form id="einfache registrierung" name="einfache registrierung" method="POST" action="<?php echo $editFormAction; ?><?php echo $loginFormAction; ?>">
      <table width="524" height="574" border="0" cellspacing="0" bgcolor="#E1E2BC">
        <tr class="registri">
          <td height="25" align="right">&nbsp; </td>
          <td height="25" colspan="5" align="left" valign="middle"><?php
if ($error != '') { 
    echo '<p>' . $error . '</p>';
}
?></td>
          <td width="24">&nbsp;</td>
        </tr>
        <tr>
          <td width="47" align="right" valign="middle">&nbsp;</td>
          <td width="131" height="68" align="right" valign="middle"><span class="Stil20">nutzername</span></td>
          <td width="6">&nbsp;</td>
          <td height="68" colspan="2" align="left" valign="middle"><span id="sprytextfield1">
            <label>
              <input name="nutzername" type="text" id="nutzername" maxlength="20" />
              <span class="Stil24">*</span></label>
          </span></td>
          <td width="5">&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        
        <tr>
          <td align="right" valign="middle" bgcolor="#F0EEDB">&nbsp;</td>
          <td height="67" colspan="5" align="center" valign="middle" bgcolor="#F0EEDB" class="ergebnisschrift">Bitte verwenden Sie f&uuml;r Ihr passwort 8 bis 15 Zeichen. Die Zeichen sollten m&ouml;glichst aus Gro&szlig;- und Kleinbuchstaben sowie Zahlen bestehen</td>
          <td bgcolor="#F0EEDB">&nbsp;</td>
        </tr>
        <tr>
          <td align="right" valign="middle">&nbsp;</td>
          <td height="21" align="right" valign="middle">&nbsp;</td>
          <td>&nbsp;</td>
          <td height="21" align="left" valign="middle">&nbsp;</td>
          <td height="21" align="left" valign="middle">&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td align="right" valign="middle">&nbsp;</td>
          <td height="33" align="right" valign="middle"><span class="Stil20">passwort</span></td>
          <td>&nbsp;</td>
          <td width="295" height="24" align="left" valign="middle"><label></label>
            <span id="sprytextfield2">
            <label>
              <input name="passwort" type="password" id="passwort" maxlength="15" />
              <span class="Stil24">*</span><span class="textfieldMinCharsMsg"><br />
              Bitte  8-15 Zeichen verwenden.</span></label>
            </span></td>
          <td width="2" height="24" align="left" valign="middle">&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        
        <tr>
          <td align="right">&nbsp;</td>
          <td height="33" align="right"><span class="Stil20">passwort wdh</span></td>
          <td>&nbsp;</td>
          <td height="24" colspan="2" align="left" valign="middle"><span id="spryconfirm1">
            <input name="passwort2" type="password" id="passwort2" maxlength="15" />
          </span><span class="Stil24">*</span></td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td align="right">&nbsp;</td>
          <td height="33" align="right">&nbsp;</td>
          <td>&nbsp;</td>
          <td height="24" colspan="2" align="left" valign="middle">&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td align="right">&nbsp;</td>
          <td height="33" align="right"><span class="Schriftangaben">tel/handy</span></td>
          <td>&nbsp;</td>
          <td height="24" colspan="2" align="left" valign="middle"><span id="sprytextfield4">
            <input name="handy" type="text" id="handy" maxlength="50" />
            </span><span class="Stil24">*</span></td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td align="right">&nbsp;</td>
          <td height="33" align="right"><span class="Schriftangaben">mail</span></td>
          <td>&nbsp;</td>
          <td height="24" colspan="2" align="left" valign="middle"><span id="sprytextfield5">
          <label>
            <input name="mail" type="text" id="mail" maxlength="50" />
            <span class="Stil24">*</span></label>
          </span></td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td align="right">&nbsp;</td>
          <td height="33" align="right">&nbsp;</td>
          <td>&nbsp;</td>
          <td height="24" colspan="2" align="left" valign="middle">&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td align="right">&nbsp;</td>
          <td height="33" align="right">&nbsp;</td>
          <td>&nbsp;</td>
          <td height="24" colspan="2" align="left" valign="middle"><img src="captcha/captcha.php" border="0" title="Sicherheitscode"></td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td align="right">&nbsp;</td>
          <td height="33" align="right">&nbsp;</td>
          <td>&nbsp;</td>
          <td height="24" colspan="2" align="left" valign="middle"><input type="text" name="sicherheitscode" size="19"></td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td align="right">&nbsp;</td>
          <td height="33" align="right">&nbsp;</td>
          <td>&nbsp;</td>
          <td height="24" colspan="2" align="left" valign="middle">&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr class="registri">
          <td height="28" align="left">&nbsp;</td>
          <td height="28" colspan="5" align="left">&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td align="right">&nbsp;</td>
          <td height="26" align="right">&nbsp;</td>
          <td>&nbsp;</td>
          <td colspan="2" align="right" valign="middle"><label>
            <input type="reset" name="Submit" value="Zur&uuml;cksetzen" />
          </label>
            <input name="abschicken" type="submit" id="abschicken" value="Senden" /></td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td align="right">&nbsp;</td>
          <td height="21" align="right">&nbsp;</td>
          <td>&nbsp;</td>
          <td colspan="2" align="right" valign="top">&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td height="21" colspan="2" align="left" valign="top" bgcolor="#FFFFFF"><span class="Stil24">*</span> <span class="Stil28">pflichtfelder </span></td>
          <td bgcolor="#FFFFFF">&nbsp;</td>
          <td colspan="2" align="left" valign="middle" bgcolor="#FFFFFF">&nbsp;</td>
          <td bgcolor="#FFFFFF">&nbsp;</td>
          <td bgcolor="#FFFFFF">&nbsp;</td>
        </tr>
      </table>
      <p>&nbsp;</p>
      <input type="hidden" name="MM_insert" value="einfache registrierung" />
    </form>    </td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td></td>
  </tr>
  
  
  
  
  
  <tr>
    <td height="19"></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td></td>
  </tr>
</table>

<map name="Map" id="Map"><area shape="rect" coords="15,16,359,79" href="1home.php" />
</map>
<script type="text/javascript">
<!--
var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1");
var sprytextfield2 = new Spry.Widget.ValidationTextField("sprytextfield2", "none", {minChars:8});
var spryconfirm1 = new Spry.Widget.ValidationConfirm("spryconfirm1", "passwort");
var sprytextfield4 = new Spry.Widget.ValidationTextField("sprytextfield4", "integer");
var sprytextfield5 = new Spry.Widget.ValidationTextField("sprytextfield5", "email");
//-->
</script>
</body>
</html>

09.12.2010 14:14

2 Jörg

hab auch ein entsprechendes script gefunden.

Gab es da eine Installations-Beschreibung bei? Bei Unklarheit kannst du diese ja hier verlinken.

Ich würde den Code bez. der Session ganz oben einbauen.

09.12.2010 15:42 | geändert: 09.12.2010 15:43

4 Jörg

Dem Kommentar im Code zufolge musst du dein Script an dieser Stelle einbauen:

//
//
//Hier kommt das ursprüngliche Script hin.
//
// 

09.12.2010 17:59

5 andehrl

Zitat von Jörg
Dem Kommentar im Code zufolge musst du dein Script an dieser Stelle einbauen:

//
//
//Hier kommt das ursprüngliche Script hin.
//
// 

und genau das weiss ich nicht wie bzw was genau genau gemeint ist. unter dem ursprunglichen script verstehe ich meinen gesammten code abgesehen vom anfänglichen php:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>mit-umzug-gelegenheit.de</title>
<script src="SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
<script src="SpryAssets/SpryValidationConfirm.js" type="text/javascript"></script>
<script type="text/JavaScript">
<!--
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

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_nbGroup(event, grpName) { //v6.0
  var i,img,nbArr,args=MM_nbGroup.arguments;
  if (event == "init" && args.length > 2) {
    if ((img = MM_findObj(args[2])) != null && !img.MM_init) {
      img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;
      if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array();
      nbArr[nbArr.length] = img;
      for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
        if (!img.MM_up) img.MM_up = img.src;
        img.src = img.MM_dn = args[i+1];
        nbArr[nbArr.length] = img;
    } }
  } else if (event == "over") {
    document.MM_nbOver = nbArr = new Array();
    for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = (img.MM_dn && args[i+2]) ? args[i+2] : ((args[i+1])? args[i+1] : img.MM_up);
      nbArr[nbArr.length] = img;
    }
  } else if (event == "out" ) {
    for (i=0; i < document.MM_nbOver.length; i++) {
      img = document.MM_nbOver[i]; img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; }
  } else if (event == "down") {
    nbArr = document[grpName];
    if (nbArr)
      for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src = img.MM_up; img.MM_dn = 0; }
    document[grpName] = nbArr = new Array();
    for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = img.MM_dn = (args[i+1])? args[i+1] : img.MM_up;
      nbArr[nbArr.length] = img;
  } }
}
//-->
</script>
<style type="text/css">
<!--
@import url("schriftangaben1111111111.css");
body {
	margin-top: 50px;
}
.Stil20 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; font-weight: bold; }
.Schriftangaben {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 10px;
	font-weight: bold;
	background-position: right center;
}
.Stil22 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold; background-position: right center; }
.Schriftstil {	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 10px;
	font-weight: bold;
}
#Layer1 {
	position:absolute;
	left:2px;
	top:1px;
	width:100%;
	height:100%;
	z-index:1;
	visibility: hidden;
}
-->
</style>
<script type="text/javascript">
<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
<link href="Seiten/Seiten/Stylesheet Formular.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.Stil23 {color: #FFFFFF}
.Stil24 {color: #000000}
.Stil28 {font-size: 14px;
	color: #000000;
}
-->
</style>
<link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" />
<link href="SpryAssets/SpryValidationConfirm.css" rel="stylesheet" type="text/css" />
</head>

<body onload="MM_preloadImages('Bilder/Home 3.png','Bilder/Home 2.png','Bilder/Home 4.png','Bilder/Mit-Umzug-Angebote 3.png','Bilder/Mit-Umzug-Angebote 4.png','Bilder/Eingabe 3.png','Bilder/Eingabe 2.png','Bilder/Eingabe 4.png','Bilder/MeinKonto 3.png','Bilder/MeinKonto 4.png','Bilder/Hilfe 3.png','Bilder/Hilfe 2.png','Bilder/Hilfe 4.png','Bilder/Mit-Umzug-Angebote 2.png')" tracingsrc="1home.php" tracingopacity="100" tracingx="0" tracingy="3458793">
<div id="Layer1"></div>
<table width="859" border="0" cellspacing="0">
  <!--DWLayoutTable-->
  <tr>
    <td width="131">&nbsp;</td>
    <td width="131">&nbsp;</td>
    <td width="131">&nbsp;</td>
    <td width="337" align="right" valign="bottom" class="Schriftangaben"><a href="9Impressum.php" class="schriftangaben11111111111">impressum</a></td>
    <td width="79" align="right" valign="bottom" class="Schriftangaben"><a href="99aRegistrierungEinfach.php" class="schriftangaben11111111111">registrierung</a></td>
    <td width="38" align="right" valign="bottom" class="Schriftangaben"><a href="8aMeinkontologin.php" class="schriftangaben11111111111">login</a></td>
  </tr>
</table>
<table width="1200" border="0" cellpadding="0" cellspacing="0">
  <!--DWLayoutTable-->
  <tr>
    <td width="54" height="160" valign="top"><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td colspan="2" valign="top"><img src="Bilder/Mit-Umzug-Gelegenheit Hauptbild.png" alt="mit-umzug-gelegenheit.de" width="805" height="160" vspace="5" border="0" usemap="#Map" /></td>
    <td width="89" valign="bottom">&nbsp;</td>
    <td width="252"></td>
  </tr>
  
  <tr>
    <td height="2"></td>
    <td width="524"></td>
    <td width="281"></td>
    <td></td>
    <td></td>
  </tr>
  <tr>
    <td height="106"></td>
    <td colspan="3" valign="top"><table border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td><a href="1home.php" target="_top" onclick="MM_nbGroup('down','group1','Home1','Bilder/Home 3.png',1)" onmouseover="MM_nbGroup('over','Home1','Bilder/Home 2.png','Bilder/Home 4.png',1)" onmouseout="MM_nbGroup('out')"><img src="Bilder/Home 1.png" alt="home" name="Home1" border="0" id="Home1" onload="" /></a></td>
        <td><a href="AngeboteoderGesucheSuchen.php" target="_top" onclick="MM_nbGroup('down','group1','MitUmzugAngebote1','Bilder/Mit-Umzug-Angebote 3.png',1)" onmouseover="MM_nbGroup('over','MitUmzugAngebote1','Bilder/Mit-Umzug-Angebote 2.png','Bilder/Mit-Umzug-Angebote 4.png',1)" onmouseout="MM_nbGroup('out')"><img src="Bilder/Mit-Umzug-Angebote 1.png" alt="suche" name="MitUmzugAngebote1" hspace="5" border="0" id="MitUmzugAngebote1" onload="" /></a></td>
        <td><a href="8aMeinkontologin.php" target="_top" onclick="MM_nbGroup('down','group1','Eingabe1','Bilder/Eingabe 3.png',1)" onmouseover="MM_nbGroup('over','Eingabe1','Bilder/Eingabe 2.png','Bilder/Eingabe 4.png',1)" onmouseout="MM_nbGroup('out')"><img src="Bilder/Eingabe 1.png" alt="eingabe" name="Eingabe1" hspace="5" border="0" id="Eingabe1" onload="" /></a></td>
        <td><a href="8aMeinkontologin.php" target="_top" onclick="MM_nbGroup('down','group1','MeinKonto1','Bilder/MeinKonto 3.png',1)" onmouseover="MM_nbGroup('over','MeinKonto1','Bilder/MeinKonto 4.png','Bilder/MeinKonto 4.png',1)" onmouseout="MM_nbGroup('out')"><img src="Bilder/MeinKonto 3.png" alt="mein konto" name="MeinKonto1" hspace="5" border="0" id="MeinKonto1" onload="" /></a></td>
        <td><a href="7hilfe.php" target="_top" onclick="MM_nbGroup('down','group1','Hilfe1','Bilder/Hilfe 3.png',1)" onmouseover="MM_nbGroup('over','Hilfe1','Bilder/Hilfe 2.png','Bilder/Hilfe 4.png',1)" onmouseout="MM_nbGroup('out')"><img src="Bilder/Hilfe 1.png" alt="hilfe" name="Hilfe1" border="0" id="Hilfe1" onload="" /></a></td>
      </tr>
    </table></td>
    <td></td>
  </tr>
  <tr>
    <td height="19"></td>
    <td height="13" align="right" valign="middle" class="schriftangaben11111111111"><a href="99bRegistrierungErweitert.php" class="schriftangaben11111111111">erweiterte registrierung</a></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td></td>
  </tr>
  <tr>
    <td height="103"></td>
    <td valign="top"><img src="Bilder/Registrieren Kopf.png" alt="registrieren" width="524" height="96" /></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td></td>
  </tr>
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  <tr>
    <td height="416"></td>
    <td align="left" valign="top"><form id="einfache registrierung" name="einfache registrierung" method="POST" action="<?php echo $editFormAction; ?><?php echo $loginFormAction; ?>">
      <table width="524" height="574" border="0" cellspacing="0" bgcolor="#E1E2BC">
        <tr class="registri">
          <td height="25" align="right">&nbsp; </td>
          <td height="25" colspan="5" align="left" valign="middle"><?php
if ($error != '') { 
    echo '<p>' . $error . '</p>';
}
?></td>
          <td width="24">&nbsp;</td>
        </tr>
        <tr>
          <td width="47" align="right" valign="middle">&nbsp;</td>
          <td width="131" height="68" align="right" valign="middle"><span class="Stil20">nutzername</span></td>
          <td width="6">&nbsp;</td>
          <td height="68" colspan="2" align="left" valign="middle"><span id="sprytextfield1">
            <label>
              <input name="nutzername" type="text" id="nutzername" maxlength="20" />
              <span class="Stil24">*</span></label>
          </span></td>
          <td width="5">&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        
        <tr>
          <td align="right" valign="middle" bgcolor="#F0EEDB">&nbsp;</td>
          <td height="67" colspan="5" align="center" valign="middle" bgcolor="#F0EEDB" class="ergebnisschrift">Bitte verwenden Sie f&uuml;r Ihr passwort 8 bis 15 Zeichen. Die Zeichen sollten m&ouml;glichst aus Gro&szlig;- und Kleinbuchstaben sowie Zahlen bestehen</td>
          <td bgcolor="#F0EEDB">&nbsp;</td>
        </tr>
        <tr>
          <td align="right" valign="middle">&nbsp;</td>
          <td height="21" align="right" valign="middle">&nbsp;</td>
          <td>&nbsp;</td>
          <td height="21" align="left" valign="middle">&nbsp;</td>
          <td height="21" align="left" valign="middle">&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td align="right" valign="middle">&nbsp;</td>
          <td height="33" align="right" valign="middle"><span class="Stil20">passwort</span></td>
          <td>&nbsp;</td>
          <td width="295" height="24" align="left" valign="middle"><label></label>
            <span id="sprytextfield2">
            <label>
              <input name="passwort" type="password" id="passwort" maxlength="15" />
              <span class="Stil24">*</span><span class="textfieldMinCharsMsg"><br />
              Bitte  8-15 Zeichen verwenden.</span></label>
            </span></td>
          <td width="2" height="24" align="left" valign="middle">&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        
        <tr>
          <td align="right">&nbsp;</td>
          <td height="33" align="right"><span class="Stil20">passwort wdh</span></td>
          <td>&nbsp;</td>
          <td height="24" colspan="2" align="left" valign="middle"><span id="spryconfirm1">
            <input name="passwort2" type="password" id="passwort2" maxlength="15" />
          </span><span class="Stil24">*</span></td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td align="right">&nbsp;</td>
          <td height="33" align="right">&nbsp;</td>
          <td>&nbsp;</td>
          <td height="24" colspan="2" align="left" valign="middle">&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td align="right">&nbsp;</td>
          <td height="33" align="right"><span class="Schriftangaben">tel/handy</span></td>
          <td>&nbsp;</td>
          <td height="24" colspan="2" align="left" valign="middle"><span id="sprytextfield4">
            <input name="handy" type="text" id="handy" maxlength="50" />
            </span><span class="Stil24">*</span></td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td align="right">&nbsp;</td>
          <td height="33" align="right"><span class="Schriftangaben">mail</span></td>
          <td>&nbsp;</td>
          <td height="24" colspan="2" align="left" valign="middle"><span id="sprytextfield5">
          <label>
            <input name="mail" type="text" id="mail" maxlength="50" />
            <span class="Stil24">*</span></label>
          </span></td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td align="right">&nbsp;</td>
          <td height="33" align="right">&nbsp;</td>
          <td>&nbsp;</td>
          <td height="24" colspan="2" align="left" valign="middle">&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td align="right">&nbsp;</td>
          <td height="33" align="right">&nbsp;</td>
          <td>&nbsp;</td>
          <td height="24" colspan="2" align="left" valign="middle"><img src="captcha/captcha.php" border="0" title="Sicherheitscode"></td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td align="right">&nbsp;</td>
          <td height="33" align="right">&nbsp;</td>
          <td>&nbsp;</td>
          <td height="24" colspan="2" align="left" valign="middle"><input type="text" name="sicherheitscode" size="19"></td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td align="right">&nbsp;</td>
          <td height="33" align="right">&nbsp;</td>
          <td>&nbsp;</td>
          <td height="24" colspan="2" align="left" valign="middle">&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr class="registri">
          <td height="28" align="left">&nbsp;</td>
          <td height="28" colspan="5" align="left">&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td align="right">&nbsp;</td>
          <td height="26" align="right">&nbsp;</td>
          <td>&nbsp;</td>
          <td colspan="2" align="right" valign="middle"><label>
            <input type="reset" name="Submit" value="Zur&uuml;cksetzen" />
          </label>
            <input name="abschicken" type="submit" id="abschicken" value="Senden" /></td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td align="right">&nbsp;</td>
          <td height="21" align="right">&nbsp;</td>
          <td>&nbsp;</td>
          <td colspan="2" align="right" valign="top">&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td height="21" colspan="2" align="left" valign="top" bgcolor="#FFFFFF"><span class="Stil24">*</span> <span class="Stil28">pflichtfelder </span></td>
          <td bgcolor="#FFFFFF">&nbsp;</td>
          <td colspan="2" align="left" valign="middle" bgcolor="#FFFFFF">&nbsp;</td>
          <td bgcolor="#FFFFFF">&nbsp;</td>
          <td bgcolor="#FFFFFF">&nbsp;</td>
        </tr>
      </table>
      <p>&nbsp;</p>
      <input type="hidden" name="MM_insert" value="einfache registrierung" />
    </form>    </td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td></td>
  </tr>
  
  
  
  
  
  <tr>
    <td height="19"></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td></td>
  </tr>
</table>

<map name="Map" id="Map"><area shape="rect" coords="15,16,359,79" href="1home.php" />
</map>
<script type="text/javascript">
<!--
var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1");
var sprytextfield2 = new Spry.Widget.ValidationTextField("sprytextfield2", "none", {minChars:8});
var spryconfirm1 = new Spry.Widget.ValidationConfirm("spryconfirm1", "passwort");
var sprytextfield4 = new Spry.Widget.ValidationTextField("sprytextfield4", "integer");
var sprytextfield5 = new Spry.Widget.ValidationTextField("sprytextfield5", "email");
//-->
</script>
</body>
</html>

aber das kann ja nicht sein. welchen teil muss ich also in die abfrage einschliessen???

09.12.2010 19:30

6 Jörg

Den gesamten Code

09.12.2010 21:24

7 andehrl

Zitat von Jörg
Den gesamten Code

sieht jetzt so aus?

<?php
session_start();
if(isset($_SESSION['captcha_spam']) AND $_POST["sicherheitscode"] == $_SESSION['captcha_spam']){
unset($_SESSION['captcha_spam']);
<?php require_once('Connections/Registrierung.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($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"] == "einfache registrierung")) {
$error = '';
mysql_select_db($database_Registrierung, $Registrierung);
$result = mysql_query("SELECT nutzername FROM login WHERE nutzername = '" . mysql_real_escape_string($_POST['nutzername']) . "'");
if (mysql_num_rows($result) > 0) {
    $error = 'Dieser Nutzername ist bereits vergeben. Bitte versuchen Sie es mit einem anderen Namen.';
} else {
    $result = mysql_query("SELECT mail FROM login WHERE mail = '" . mysql_real_escape_string($_POST['mail']) . "'");
    if (mysql_num_rows($result) > 0) {
        $error = 'Diese Emailadresse ist bereits vergeben. Bitte versuchen Sie es mit einer anderen E-Mail.';
    }
	echo mysql_error();
}
echo mysql_error();

if ($error == "") {
    $insertSQL = sprintf("INSERT INTO login (vornachname, nutzername, passwort, mail, handy) VALUES (%s, %s, %s, %s, %s)",
                       GetSQLValueString($_POST['vornachname'], "text"),
                       GetSQLValueString($_POST['nutzername'], "text"),
                       GetSQLValueString($_POST['passwort'], "text"),
                       GetSQLValueString($_POST['mail'], "text"),
                       GetSQLValueString($_POST['handy'], "text"));
  
  $Result1 = mysql_query($insertSQL, $Registrierung) or die(mysql_error());

  $insertGoTo = "8cSieSindEingeloggt.php";
  if (isset($_SERVER['QUERY_STRING'])) {
    $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
    $insertGoTo .= $_SERVER['QUERY_STRING'];
  }
  header(sprintf("Location: %s", $insertGoTo));
}
}

?>
<?php
// *** Validate request to login to this site.
if (!isset($_SESSION)) {
  session_start();
}

$loginFormAction = $_SERVER['PHP_SELF'];
if (isset($_GET['accesscheck'])) {
  $_SESSION['PrevUrl'] = $_GET['accesscheck'];
}

if (isset($_POST['nutzername']) && empty($error)) {
  $loginUsername=$_POST['nutzername'];
  $password=$_POST['passwort'];
  $MM_fldUserAuthorization = "";
  $MM_redirectLoginSuccess = "8cSieSindEingeloggt.php";
  $MM_redirectLoginFailed = "8bMeinkontologinfehlgeschlagen.php";
  $MM_redirecttoReferrer = true;
  mysql_select_db($database_Registrierung, $Registrierung);
  
  $LoginRS__query=sprintf("SELECT nutzername, passwort FROM login WHERE nutzername=%s AND passwort=%s",
    GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text")); 
   
  $LoginRS = mysql_query($LoginRS__query, $Registrierung) or die(mysql_error());
  $loginFoundUser = mysql_num_rows($LoginRS);
  if ($loginFoundUser) {
     $loginStrGroup = "";
    
    //declare two session variables and assign them
    $_SESSION['MM_Username'] = $loginUsername;
    $_SESSION['MM_UserGroup'] = $loginStrGroup;	      

    if (isset($_SESSION['PrevUrl']) && true) {
      $MM_redirectLoginSuccess = $_SESSION['PrevUrl'];	
    }
    header("Location: " . $MM_redirectLoginSuccess );
  }
  else {
    header("Location: ". $MM_redirectLoginFailed );
  }
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>mit-umzug-gelegenheit.de</title>
<script src="SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
<script src="SpryAssets/SpryValidationConfirm.js" type="text/javascript"></script>
<script type="text/JavaScript">
<!--
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

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_nbGroup(event, grpName) { //v6.0
  var i,img,nbArr,args=MM_nbGroup.arguments;
  if (event == "init" && args.length > 2) {
    if ((img = MM_findObj(args[2])) != null && !img.MM_init) {
      img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;
      if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array();
      nbArr[nbArr.length] = img;
      for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
        if (!img.MM_up) img.MM_up = img.src;
        img.src = img.MM_dn = args[i+1];
        nbArr[nbArr.length] = img;
    } }
  } else if (event == "over") {
    document.MM_nbOver = nbArr = new Array();
    for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = (img.MM_dn && args[i+2]) ? args[i+2] : ((args[i+1])? args[i+1] : img.MM_up);
      nbArr[nbArr.length] = img;
    }
  } else if (event == "out" ) {
    for (i=0; i < document.MM_nbOver.length; i++) {
      img = document.MM_nbOver[i]; img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; }
  } else if (event == "down") {
    nbArr = document[grpName];
    if (nbArr)
      for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src = img.MM_up; img.MM_dn = 0; }
    document[grpName] = nbArr = new Array();
    for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = img.MM_dn = (args[i+1])? args[i+1] : img.MM_up;
      nbArr[nbArr.length] = img;
  } }
}
//-->
</script>
<style type="text/css">
<!--
@import url("schriftangaben1111111111.css");
body {
	margin-top: 50px;
}
.Stil20 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; font-weight: bold; }
.Schriftangaben {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 10px;
	font-weight: bold;
	background-position: right center;
}
.Stil22 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold; background-position: right center; }
.Schriftstil {	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 10px;
	font-weight: bold;
}
#Layer1 {
	position:absolute;
	left:2px;
	top:1px;
	width:100%;
	height:100%;
	z-index:1;
	visibility: hidden;
}
-->
</style>
<script type="text/javascript">
<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
<link href="Seiten/Seiten/Stylesheet Formular.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.Stil23 {color: #FFFFFF}
.Stil24 {color: #000000}
.Stil28 {font-size: 14px;
	color: #000000;
}
-->
</style>
<link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" />
<link href="SpryAssets/SpryValidationConfirm.css" rel="stylesheet" type="text/css" />
</head>

<body onload="MM_preloadImages('Bilder/Home 3.png','Bilder/Home 2.png','Bilder/Home 4.png','Bilder/Mit-Umzug-Angebote 3.png','Bilder/Mit-Umzug-Angebote 4.png','Bilder/Eingabe 3.png','Bilder/Eingabe 2.png','Bilder/Eingabe 4.png','Bilder/MeinKonto 3.png','Bilder/MeinKonto 4.png','Bilder/Hilfe 3.png','Bilder/Hilfe 2.png','Bilder/Hilfe 4.png','Bilder/Mit-Umzug-Angebote 2.png')" tracingsrc="1home.php" tracingopacity="100" tracingx="0" tracingy="3458793">
<div id="Layer1"></div>
<table width="859" border="0" cellspacing="0">
  <!--DWLayoutTable-->
  <tr>
    <td width="131">&nbsp;</td>
    <td width="131">&nbsp;</td>
    <td width="131">&nbsp;</td>
    <td width="337" align="right" valign="bottom" class="Schriftangaben"><a href="9Impressum.php" class="schriftangaben11111111111">impressum</a></td>
    <td width="79" align="right" valign="bottom" class="Schriftangaben"><a href="99aRegistrierungEinfach.php" class="schriftangaben11111111111">registrierung</a></td>
    <td width="38" align="right" valign="bottom" class="Schriftangaben"><a href="8aMeinkontologin.php" class="schriftangaben11111111111">login</a></td>
  </tr>
</table>
<table width="1200" border="0" cellpadding="0" cellspacing="0">
  <!--DWLayoutTable-->
  <tr>
    <td width="54" height="160" valign="top"><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td colspan="2" valign="top"><img src="Bilder/Mit-Umzug-Gelegenheit Hauptbild.png" alt="mit-umzug-gelegenheit.de" width="805" height="160" vspace="5" border="0" usemap="#Map" /></td>
    <td width="89" valign="bottom">&nbsp;</td>
    <td width="252"></td>
  </tr>
  
  <tr>
    <td height="2"></td>
    <td width="524"></td>
    <td width="281"></td>
    <td></td>
    <td></td>
  </tr>
  <tr>
    <td height="106"></td>
    <td colspan="3" valign="top"><table border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td><a href="1home.php" target="_top" onclick="MM_nbGroup('down','group1','Home1','Bilder/Home 3.png',1)" onmouseover="MM_nbGroup('over','Home1','Bilder/Home 2.png','Bilder/Home 4.png',1)" onmouseout="MM_nbGroup('out')"><img src="Bilder/Home 1.png" alt="home" name="Home1" border="0" id="Home1" onload="" /></a></td>
        <td><a href="AngeboteoderGesucheSuchen.php" target="_top" onclick="MM_nbGroup('down','group1','MitUmzugAngebote1','Bilder/Mit-Umzug-Angebote 3.png',1)" onmouseover="MM_nbGroup('over','MitUmzugAngebote1','Bilder/Mit-Umzug-Angebote 2.png','Bilder/Mit-Umzug-Angebote 4.png',1)" onmouseout="MM_nbGroup('out')"><img src="Bilder/Mit-Umzug-Angebote 1.png" alt="suche" name="MitUmzugAngebote1" hspace="5" border="0" id="MitUmzugAngebote1" onload="" /></a></td>
        <td><a href="8aMeinkontologin.php" target="_top" onclick="MM_nbGroup('down','group1','Eingabe1','Bilder/Eingabe 3.png',1)" onmouseover="MM_nbGroup('over','Eingabe1','Bilder/Eingabe 2.png','Bilder/Eingabe 4.png',1)" onmouseout="MM_nbGroup('out')"><img src="Bilder/Eingabe 1.png" alt="eingabe" name="Eingabe1" hspace="5" border="0" id="Eingabe1" onload="" /></a></td>
        <td><a href="8aMeinkontologin.php" target="_top" onclick="MM_nbGroup('down','group1','MeinKonto1','Bilder/MeinKonto 3.png',1)" onmouseover="MM_nbGroup('over','MeinKonto1','Bilder/MeinKonto 4.png','Bilder/MeinKonto 4.png',1)" onmouseout="MM_nbGroup('out')"><img src="Bilder/MeinKonto 3.png" alt="mein konto" name="MeinKonto1" hspace="5" border="0" id="MeinKonto1" onload="" /></a></td>
        <td><a href="7hilfe.php" target="_top" onclick="MM_nbGroup('down','group1','Hilfe1','Bilder/Hilfe 3.png',1)" onmouseover="MM_nbGroup('over','Hilfe1','Bilder/Hilfe 2.png','Bilder/Hilfe 4.png',1)" onmouseout="MM_nbGroup('out')"><img src="Bilder/Hilfe 1.png" alt="hilfe" name="Hilfe1" border="0" id="Hilfe1" onload="" /></a></td>
      </tr>
    </table></td>
    <td></td>
  </tr>
  <tr>
    <td height="19"></td>
    <td height="13" align="right" valign="middle" class="schriftangaben11111111111"><a href="99bRegistrierungErweitert.php" class="schriftangaben11111111111">erweiterte registrierung</a></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td></td>
  </tr>
  <tr>
    <td height="103"></td>
    <td valign="top"><img src="Bilder/Registrieren Kopf.png" alt="registrieren" width="524" height="96" /></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td></td>
  </tr>
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  <tr>
    <td height="416"></td>
    <td align="left" valign="top"><form id="einfache registrierung" name="einfache registrierung" method="POST" action="<?php echo $editFormAction; ?><?php echo $loginFormAction; ?>">
      <table width="524" height="574" border="0" cellspacing="0" bgcolor="#E1E2BC">
        <tr class="registri">
          <td height="25" align="right">&nbsp; </td>
          <td height="25" colspan="5" align="left" valign="middle"><?php
if ($error != '') { 
    echo '<p>' . $error . '</p>';
}
?></td>
          <td width="24">&nbsp;</td>
        </tr>
        <tr>
          <td width="47" align="right" valign="middle">&nbsp;</td>
          <td width="131" height="68" align="right" valign="middle"><span class="Stil20">nutzername</span></td>
          <td width="6">&nbsp;</td>
          <td height="68" colspan="2" align="left" valign="middle"><span id="sprytextfield1">
            <label>
              <input name="nutzername" type="text" id="nutzername" maxlength="20" />
              <span class="Stil24">*</span></label>
          </span></td>
          <td width="5">&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        
        <tr>
          <td align="right" valign="middle" bgcolor="#F0EEDB">&nbsp;</td>
          <td height="67" colspan="5" align="center" valign="middle" bgcolor="#F0EEDB" class="ergebnisschrift">Bitte verwenden Sie f&uuml;r Ihr passwort 8 bis 15 Zeichen. Die Zeichen sollten m&ouml;glichst aus Gro&szlig;- und Kleinbuchstaben sowie Zahlen bestehen</td>
          <td bgcolor="#F0EEDB">&nbsp;</td>
        </tr>
        <tr>
          <td align="right" valign="middle">&nbsp;</td>
          <td height="21" align="right" valign="middle">&nbsp;</td>
          <td>&nbsp;</td>
          <td height="21" align="left" valign="middle">&nbsp;</td>
          <td height="21" align="left" valign="middle">&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td align="right" valign="middle">&nbsp;</td>
          <td height="33" align="right" valign="middle"><span class="Stil20">passwort</span></td>
          <td>&nbsp;</td>
          <td width="295" height="24" align="left" valign="middle"><label></label>
            <span id="sprytextfield2">
            <label>
              <input name="passwort" type="password" id="passwort" maxlength="15" />
              <span class="Stil24">*</span><span class="textfieldMinCharsMsg"><br />
              Bitte  8-15 Zeichen verwenden.</span></label>
            </span></td>
          <td width="2" height="24" align="left" valign="middle">&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        
        <tr>
          <td align="right">&nbsp;</td>
          <td height="33" align="right"><span class="Stil20">passwort wdh</span></td>
          <td>&nbsp;</td>
          <td height="24" colspan="2" align="left" valign="middle"><span id="spryconfirm1">
            <input name="passwort2" type="password" id="passwort2" maxlength="15" />
          </span><span class="Stil24">*</span></td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td align="right">&nbsp;</td>
          <td height="33" align="right">&nbsp;</td>
          <td>&nbsp;</td>
          <td height="24" colspan="2" align="left" valign="middle">&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td align="right">&nbsp;</td>
          <td height="33" align="right"><span class="Schriftangaben">tel/handy</span></td>
          <td>&nbsp;</td>
          <td height="24" colspan="2" align="left" valign="middle"><span id="sprytextfield4">
            <input name="handy" type="text" id="handy" maxlength="50" />
            </span><span class="Stil24">*</span></td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td align="right">&nbsp;</td>
          <td height="33" align="right"><span class="Schriftangaben">mail</span></td>
          <td>&nbsp;</td>
          <td height="24" colspan="2" align="left" valign="middle"><span id="sprytextfield5">
          <label>
            <input name="mail" type="text" id="mail" maxlength="50" />
            <span class="Stil24">*</span></label>
          </span></td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td align="right">&nbsp;</td>
          <td height="33" align="right">&nbsp;</td>
          <td>&nbsp;</td>
          <td height="24" colspan="2" align="left" valign="middle">&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td align="right">&nbsp;</td>
          <td height="33" align="right">&nbsp;</td>
          <td>&nbsp;</td>
          <td height="24" colspan="2" align="left" valign="middle"><img src="captcha/captcha.php" border="0" title="Sicherheitscode"></td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td align="right">&nbsp;</td>
          <td height="33" align="right">&nbsp;</td>
          <td>&nbsp;</td>
          <td height="24" colspan="2" align="left" valign="middle"><input type="text" name="sicherheitscode" size="19"></td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td align="right">&nbsp;</td>
          <td height="33" align="right">&nbsp;</td>
          <td>&nbsp;</td>
          <td height="24" colspan="2" align="left" valign="middle">&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr class="registri">
          <td height="28" align="left">&nbsp;</td>
          <td height="28" colspan="5" align="left">&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td align="right">&nbsp;</td>
          <td height="26" align="right">&nbsp;</td>
          <td>&nbsp;</td>
          <td colspan="2" align="right" valign="middle"><label>
            <input type="reset" name="Submit" value="Zur&uuml;cksetzen" />
          </label>
            <input name="abschicken" type="submit" id="abschicken" value="Senden" /></td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td align="right">&nbsp;</td>
          <td height="21" align="right">&nbsp;</td>
          <td>&nbsp;</td>
          <td colspan="2" align="right" valign="top">&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td height="21" colspan="2" align="left" valign="top" bgcolor="#FFFFFF"><span class="Stil24">*</span> <span class="Stil28">pflichtfelder </span></td>
          <td bgcolor="#FFFFFF">&nbsp;</td>
          <td colspan="2" align="left" valign="middle" bgcolor="#FFFFFF">&nbsp;</td>
          <td bgcolor="#FFFFFF">&nbsp;</td>
          <td bgcolor="#FFFFFF">&nbsp;</td>
        </tr>
      </table>
      <p>&nbsp;</p>
      <input type="hidden" name="MM_insert" value="einfache registrierung" />
    </form>    </td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td></td>
  </tr>
  
  
  
  
  
  <tr>
    <td height="19"></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td></td>
  </tr>
</table>

<map name="Map" id="Map"><area shape="rect" coords="15,16,359,79" href="1home.php" />
</map>
<script type="text/javascript">
<!--
var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1");
var sprytextfield2 = new Spry.Widget.ValidationTextField("sprytextfield2", "none", {minChars:8});
var spryconfirm1 = new Spry.Widget.ValidationConfirm("spryconfirm1", "passwort");
var sprytextfield4 = new Spry.Widget.ValidationTextField("sprytextfield4", "integer");
var sprytextfield5 = new Spry.Widget.ValidationTextField("sprytextfield5", "email");
//-->
</script>
</body>
</html>
}
?>


ich erhalte dann diese fehlermeldung:

Parse error: syntax error, unexpected '<' in /is/htdocs/wp10548565_XUUKREW8G9/www/99aRegistrierungEinfach.php on line 5

zeile 5 ist diese:

<?php require_once('Connections/Registrierung.php'); ?>

09.12.2010 21:36

9 andehrl

Zitat von Jörg
Du musst die "<?php" und "?>" richtig setzen:

http://www.php.net/manual/de/language.basic-syntax.phpmode.php

tut mir leid, ich steh aufm schlauch. ich habe doch am anfang des codes "<?php" , dann die captcha-session gefolgt von meinem script, und am ende dann "?>", so wie es in der beschreibung steht.
ich sehe auch nicht den unterschied in deinem link, sorry.

09.12.2010 22:40

10 Jörg

ich habe doch am anfang des codes "<?php"

Ja und genau deswegen ist das zweite "<?php" in Zeile 5 überflüssig - du befindest dich dort bereits im PHP-Modus.

09.12.2010 22:57 | geändert: 09.12.2010 22:58