Finde den Fehler nicht

alex130

Erfahrenes Mitglied
Hi
Ich hab ein Problem und zwar hab ich ein Registrierungsscript gemacht, doch ich weiß einfach nicht wo ich den Fehler habe.
Hier mein Code:
PHP:
<?php
  
  	ob_start();
  	include ("configs/config.inc.php");    
    
 	$code = md5(rand(0,100000)); 
  
	$header = "Return-Path: ".$_CONFIG['email']."\n";
	$header .= "X-Sender: ".$_CONFIG['email']."\n";
	$header .= "From: ".$_CONFIG['email']." <".$_CONFIG['email'].">\n";
	$header .= "X-Mailer:PHP 5.1\n";
	$header .= "MIME-Version: 1.0\n";	
	
 	$betreff = "Aktivierung des Accounts";  
 	$text = " 
Hallo ".mysql_real_escape_string($_POST["username"])." 
Du hast dich bei ".$_CONFIG['sitename']." registriert.  
Du musst aber noch dein Account aktivieren bitte klicke hierzu auf den Link!  
   
".$_CONFIG['site_url']."index.php?site=activate&code=".$code."&username=".$_POST["username"]."";
 	// Email ENDE  
  
 	$userrows = mysql_num_rows(mysql_query('SELECT '.$mysql_usertable_user.' FROM '.$mysql_usertable.' WHERE '.$mysql_usertable_user.		 	'="'.$_POST['username'].'"')); 
   
   
 	if ($_POST['registersubmit']) 
 	{ 
		if($_POST['password'] !== $_POST['password2'])
		{
			header("Location: index.php?site=false_pw");
		}
		else
		{
   			if (empty($_POST['username']) || empty($_POST['password']) || empty($_POST['password2']) || empty($_POST['email']) || empty( 			 			$_POST['anrede']) || empty($_POST['vorname']) || empty($_POST['nachname']) || empty($_POST['firma']) || empty($_POST[ 		 	 			'unternehmensform']) || empty($_POST['strasse']) || empty($_POST['plz']) || empty($_POST['ort']) || empty($_POST['land']) ||  	 			empty($_POST['telefon']) || empty($_POST['homepage'])) 
     	{ 
      		echo "Bitte f&uuml;llen Sie alle Felder aus!"; 
     	} 
     	elseif ($userrows != 0) 
     	{ 
   			header("Location: index.php?site=user_exist");
 		} 
    	 else 
     	{ 
       		mysql_query('INSERT INTO '.$mysql_usertable.'('.$mysql_usertable_user.','.$mysql_usertable_password.', email,  		 	 				 			activate_code, anrede, vorname, nachname, firma, unternehmensform, strasse, plz, ort, land, telefon, homepage) VALUES("'. 			 			mysql_real_escape_string($_POST['username']).'","'.md5($_POST['password']).'","'.mysql_real_escape_string($_POST['email']). 		 			'","'.$code.'","'.mysql_real_escape_string($_POST['anrede']).'","'.mysql_real_escape_string($_POST['vorname']).'","'. 			 			mysql_real_escape_string($_POST['nachname']).'","'.mysql_real_escape_string($_POST['firma']).'","'.mysql_real_escape_string( 				 			$_POST['unternehmensform']).'","'.mysql_real_escape_string($_POST['strasse']).'","'.mysql_real_escape_string($_POST['plzm']). 	 			'","'.mysql_real_escape_string($_POST['ort']).'","'.mysql_real_escape_string($_POST['land']).'","'.mysql_real_escape_string( 		 			$_POST['telefon']).'","'.mysql_real_escape_string($_POST['homepage']).'")'); 

			header("Location: index.php?site=register_done"); 
     	} 
		}
	}
 	else 
 	{ 
		include("templates/register.php");
 	} 
  
  	ob_end_flush(); 

?>

Es kommt immer "Bitte füllen Sie alle Felder aus!"
 
Ich denke mal du hast dein Formular nicht richtig ausgefüllt, poste es mal bitte hier.

PHP:
if($_POST['password'] !== $_POST['password2'])

Bitte nur ein =-Zeichen
 
HI
Hier mein Formular:
HTML:
<form method="post" action="register.php">
<table width="500" border="0">
  <tr>
    <td><h3>Anmeldung</h3></td>
    <td></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  </table>
  <fieldset style="width:360px;"><legend>User Daten</legend>
  <table width="400" border="0" align="center">
  <tr>
    <td>Benutzername</td>
    <td><input type="text" size="25" name="username" /></td>
  </tr>
  <tr>
    <td>Email</td>
    <td><input type="text" size="25" name="email" /></td>
  </tr>
  <tr>
    <td>Passwort</td>
    <td><input type="password" size="25" name="password" /></td>
  </tr>
  <tr>
    <td>Pw best&auml;tigen </td>
    <td><input type="password" size="25" name="password2" /></td>
  </tr>
  </table>
  </fieldset>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <fieldset style="width:300px; text-align:justify;"><legend>Personendaten</legend>
  <table width="400" border="0" align="center">
  <tr>
    <td>Anrede</td>
    <td>
	<select name="anrede">
	<option value="Herr">Herr</option>
	<option value="Frau">Frau</option>
	</select>
	</td>
  </tr>
  <tr>
    <td>Vorname</td>
    <td><input type="text" size="25" name="vorname" /></td>
  </tr>
  <tr>
    <td>Nachname</td>
    <td><input type="text" size="25" name="nachname" /></td>
  </tr>
  <tr>
    <td>Firma</td>
    <td><input type="text" size="25" name="firma" /></td>
  </tr>
  <tr>
    <td>Unternehmesform</td>
    <td><input type="text" size="25" name="unternehmensform" /></td>
  </tr>
  <tr>
    <td>Stra&szlig;e</td>
    <td><input type="text" size="25" name="strasse" /></td>
  </tr>
  <tr>
    <td>Plz</td>
    <td><input type="text" size="5" name="plz" /></td>
  </tr>
  <tr>
    <td>Ort</td>
    <td><input type="text" size="25" name="ort" /></td>
  </tr>
  <tr>
    <td>Land</td>
    <td><input type="text" name="land" size="25" /></td>
  </tr>
  <tr>
    <td>Telefon / Fax </td>
    <td><input type="text" size="25" name="telefon" /></td>
  </tr>
  <tr>
    <td>Homepage</td>
    <td><input type="text" size="25" name="homepage" value="http://" /></td>
  </tr>
    <tr>
    <td>&nbsp;</td>
    <td><input type="submit" name="registersubmit" value="Anmelden" /></td>
  </tr>
  </table>
  </fieldset>
</table>
</form>
 
PHP:
<?php
  
      ob_start();
      include ("configs/config.inc.php");    
    
     $code = md5(rand(0,100000)); 
  
    $header = "Return-Path: ".$_CONFIG['email']."\n";
    $header .= "X-Sender: ".$_CONFIG['email']."\n";
    $header .= "From: ".$_CONFIG['email']." <".$_CONFIG['email'].">\n";
    $header .= "X-Mailer:PHP 5.1\n";
    $header .= "MIME-Version: 1.0\n";    
    
     $betreff = "Aktivierung des Accounts";  
     $text = " 
Hallo ".mysql_real_escape_string($_POST["username"])." 
Du hast dich bei ".$_CONFIG['sitename']." registriert.  
Du musst aber noch dein Account aktivieren bitte klicke hierzu auf den Link!  
   
".$_CONFIG['site_url']."index.php?site=activate&code=".$code."&username=".$_POST["username"]."";
     // Email ENDE  
  
     $userrows = mysql_num_rows(mysql_query('SELECT '.$mysql_usertable_user.' FROM '.$mysql_usertable.' WHERE '.$mysql_usertable_user.'="'.$_POST['username'].'"')); 
   
   
     if (isset($_POST['registersubmit']) 
     { 
        if($_POST['password'] !== $_POST['password2'])
        {
            header("Location: index.php?site=false_pw");
        }
        else
        {
               if (empty($_POST['username']) || empty($_POST['password']) || empty($_POST['password2']) || empty($_POST['email']) || empty($_POST['anrede']) || empty($_POST['vorname']) || empty($_POST['nachname']) || empty($_POST['firma']) || empty($_POST['unternehmensform']) || empty($_POST['strasse']) || empty($_POST['plz']) || empty($_POST['ort']) || empty($_POST['land']) || empty($_POST['telefon']) || empty($_POST['homepage'])) 
         { 
              echo "Bitte f&uuml;llen Sie alle Felder aus!"; 
         } 
         elseif ($userrows != 0) 
         { 
               header("Location: index.php?site=user_exist");
         } 
         else 
         { 
               mysql_query('INSERT INTO '.$mysql_usertable.'('.$mysql_usertable_user.','.$mysql_usertable_password.', email, activate_code, anrede, vorname, nachname, firma, unternehmensform, strasse, plz, ort, land, telefon, homepage) VALUES("'.mysql_real_escape_string($_POST['username']).'","'.md5($_POST['password']).'","'.mysql_real_escape_string($_POST['email']).'","'.$code.'","'.mysql_real_escape_string($_POST['anrede']).'","'.mysql_real_escape_string($_POST['vorname']).'","'.mysql_real_escape_string($_POST['nachname']).'","'.mysql_real_escape_string($_POST['firma']).'","'.mysql_real_escape_string($_POST['unternehmensform']).'","'.mysql_real_escape_string($_POST['strasse']).'","'.mysql_real_escape_string($_POST['plzm']).'","'.mysql_real_escape_string($_POST['ort']).'","'.mysql_real_escape_string($_POST['land']).'","'.mysql_real_escape_string($_POST['telefon']).'","'.mysql_real_escape_string($_POST['homepage']).'")'); 

            header("Location: index.php?site=register_done"); 
         } 
        }
    }
     else 
     { 
        include("templates/register.php");
     } 
  
      ob_end_flush(); 

?>

Versuche es mal so.
 
Zuletzt bearbeitet:
Hi
Jetzt kommt:
PHP:
Parse error: parse error, unexpected '{' in /var/www/web14/html/devin/register.php on line 27
lg
 
PHP:
if (isset($_POST['registersubmit'])
Die Klammer wurde nicht geschlossen:
PHP:
if (isset($_POST['registersubmit']))
 
Zurück