@fox34 : Das "Problem" ist momentan noch, dass seine gesamte form etc. innerhalb php-tags steht. Wenn ich also nicht falsch informiert bin, muss er fast alle " in ' ändern.
Sein code :
Richtig wäre (meines Wissens nach) folgender code :
Sein code :
PHP-Code:
<?
$Buchstaben = array("a", "b", "c", "d", "e", "f", "g", "h", "k", "m", "n", "p", "q", "r", "s", "t", "u",
"v", "w", "x", "y", "z");
$Zahlen = array("2", "3", "4", "5", "6", "7", "8", "9");
$Sonderzeichen = array(".", "!", "%", "&", "=", "?");
$Laenge = 8;
for($i=0, $Passwort=""; strlen($Passwort)<$Laenge; $i++)
{
if(rand(0, 2)==0 && isset($Buchstaben))
{
$Passwort.=$Buchstaben[rand(0, count($Buchstaben))];
}
elseif(rand(0, 2)==1 && isset($Zahlen))
{
$Passwort.=$Zahlen[rand(0, count($Zahlen))];
}
elseif(rand(0, 2)==2 && isset($Sonderzeichen))
{
$Passwort.=$Sonderzeichen[rand(0, count($Sonderzeichen))];
}
}
$Passwort;
include ('connect.php');
echo '<table width="600" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><form name="test" method="post" action="schreiben.php">
<table width="600" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td>
<table width="600" border="0" cellspacing="0" align="center" cellpadding="0">
<tr>
<td width="620" bgcolor=""><div align="center">
<table width="600" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="116">Name:*</td>
<td width="252"><input type="text" name="name" size="20"></td>
<td width="252" rowspan="4"><table width="200" border="0" cellspacing="0" cellpadding="0">
<tr>';
echo '</tr>
</table></td>
</tr>
<tr>
<td>Vorname:*</td>
<td><input type="text" name="vorname" size="20"></td>
</tr>
<tr>
<td>Strasse</td>
<td><input type="text" name="strasse" size="20"></td>
</tr>
<tr>
<td>Nr.*</td>
<td><input type="text" name="nr" size="3"></td>
</tr>
<tr>
<td>Ort:*</td>
<td><input type="text" name="ort" size="20"></td>
</tr>
<tr>
<td>Land:*</td>
<td><input type="text" name="land" size="20"></td>
</tr>
<tr>
<td>Plz:*</td>
<td><input type="text" name="plz" size="6"></td>
</tr>
<tr>
<td>email:*</td>
<td><input type="text" name="email" size="20"></td>
</tr>
<tr>
<td><input type="hidden" name="passwort" value="<?php echo ($Passwort) ?>"></td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
</table>
<div align="center"><span class="Stil2">Felder mit * müssen ausgefüllt werden</span> </div> <br>
<input name="submit" type="submit" value="Eintragen">
<br>
</div></td>
</tr>
</table></td>
</tr>
</table></form> </td>
</tr>
</table>';
PHP-Code:
<?php
$Buchstaben = array("a", "b", "c", "d", "e", "f", "g", "h", "k", "m", "n", "p", "q", "r", "s", "t", "u",
"v", "w", "x", "y", "z");
$Zahlen = array("2", "3", "4", "5", "6", "7", "8", "9");
$Sonderzeichen = array(".", "!", "%", "&", "=", "?");
$Laenge = 8;
for($i=0, $Passwort=""; strlen($Passwort)<$Laenge; $i++)
{
if(rand(0, 2)==0 && isset($Buchstaben))
{
$Passwort.=$Buchstaben[rand(0, count($Buchstaben))];
}
elseif(rand(0, 2)==1 && isset($Zahlen))
{
$Passwort.=$Zahlen[rand(0, count($Zahlen))];
}
elseif(rand(0, 2)==2 && isset($Sonderzeichen))
{
$Passwort.=$Sonderzeichen[rand(0, count($Sonderzeichen))];
}
}
$Passwort;
include ('connect.php');
echo "<table width='600' border='0' align='center' cellpadding='0' cellspacing='0'>
<tr>
<td><form name='test' method='post' action='schreiben.php'>
<table width='600' border='0' align='center' cellpadding='0' cellspacing='0'>
<tr>
<td>
<table width='600' border='0' cellspacing='0' align='center' cellpadding='0'>
<tr>
<td width='620' bgcolor=''><div align='center'>
<table width='600' border='0' align='center' cellpadding='0' cellspacing='0'>
<tr>
<td width='116'>Name:*</td>
<td width='252'><input type='text' name='name' size='20'></td>
<td width='252' rowspan='4'><table width='200' border='0' cellspacing='0' cellpadding='0'>
<tr>";
echo "</tr>
</table></td>
</tr>
<tr>
<td>Vorname:*</td>
<td><input type='text' name='vorname' size='20'></td>
</tr>
<tr>
<td>Strasse</td>
<td><input type='text' name='strasse' size='20'></td>
</tr>
<tr>
<td>Nr.*</td>
<td><input type='text' name='nr' size='3'></td>
</tr>
<tr>
<td>Ort:*</td>
<td><input type='text' name='ort' size='20'></td>
</tr>
<tr>
<td>Land:*</td>
<td><input type='text' name='land' size='20'></td>
</tr>
<tr>
<td>Plz:*</td>
<td><input type='text' name='plz' size='6'></td>
</tr>
<tr>
<td>email:*</td>
<td><input type='text' name='email' size='20'></td>
</tr>
<tr>
<td><input type='hidden' name='passwort' value='".$Passwort."'></td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
</table>
<div align='center'><span class='Stil2'>Felder mit * müssen ausgefüllt werden</span> </div> <br>
<input name='submit' type='submit' value='Eintragen'>
<br>
</div></td>
</tr>
</table></td>
</tr>
</table></form> </td>
</tr>
</table>";
?>
Kommentar