Warnung: file_put_contents(/home/www/web1/html/php_dev/test.txt) [function.file-put-contents]: failed to open stream: Permission denied in /home/www/web1/html/php_dev/sys/lib.activity.php (Zeile 58)
Fehler in Code "HILFE" [Archiv] - PHP-Scripte PHP-Tutorials PHP-Jobs und vieles mehr

- Ad -
php-resource




Archiv verlassen und diese Seite im Standarddesign anzeigen :
Fehler in Code "HILFE"


 
Schneggo
30-07-2002, 13:30 
 
Das Auswahlmenü von Abteilung ist leer und die submit und reset Buttons erscheinen auch nicht

<?
$intSecurity = 0;
$intTimeOut = 900;
$intSecFolder = TRUE;
$strPageTitle = "Create a new user";

Include("../includes/security.inc.php");
Include("../includes/functions.inc.php");
Include("../includes/db.inc.php");

If ($HTTP_POST_VARS["btnSubmit"] != "") {
$strUserID = validateText("User ID", $txtUserID, 3, 20, TRUE, FALSE);
$strFirstName = validateText("First Name", $txtFirstName, 2, 40, TRUE, FALSE);
$strMiddleInit = validateText("Middle Initial", $txtMiddleInit, 1, 1, FALSE, FALSE);
$strLastName = validateText("Last Name", $txtLastName, 2, 40, TRUE, FALSE);
$strEmail = validateEmail("Email Address", $txtEmail, TRUE);
If ($cboAbteilung == "" AND $strError == "") {
$strError = "Please select a Department.";
} Else {
$intAbteilung = $cboAbteilung;
}

If ($strError == "") {
$strSQL = "SELECT id FROM tblSecurity WHERE userID='$strUserID'";
$result = dbquery($strSQL);
$intFound = mysql_num_rows($result);
If ($intFound != 0) {
$strError = "That userID already exists.";
} Else {
$strSQL = "SELECT id FROM tblSecurity WHERE email='$strEmail'";
$result = dbquery($strSQL);
$intFound = mysql_num_rows($result);
If ($intFound != 0) {
$strError = "That email address already exists.";
} Else {
If ($intLevel != 3) {
$strTempString = "ABCDEFGHIJKLMNPQRSTUVWXYZ123456789";
for ($i = 0; $i < 8; $i++) {
srand ((double) microtime() * 1000000);
$intPos = rand(0, 33);
$strTempChar = substr($strTempString, $intPos, 1);
$strPassword = $strPassword.$strTempChar;
}
} Else {
$strPassword = "nonuser1";
}
$strPassword2 = md5($strPassword);
$strSQL = "INSERT INTO tblSecurity (userID, password, firstName, middleInit, lastName, email, securityLevel) VALUES ('$strUserID', '$strPassword2', '$strFirstName', '$strMiddleInit', '$strLastName', '$strEmail', $intLevel)";
$result = dbquery($strSQL);
$strError = "User '$strUserID' has been added successfully.";
$addSuccessful = TRUE;

If ($intLevel != 3) {
$strURL = makeHomeURL("/security/createUser.php");

$msgBody = "Your phpMyInventory username is '$strUserID' and your temporary password is '$strPassword'. ";
$msgBody .= "You may log in at $strURL.";
mail($strEmail, "phpMyInventory account created: ".date("m-d-Y"), $msgBody);
}
}
}
}
}

Include("../includes/header.inc.php");
declareError(TRUE);
?>

Users created through this tool will automatically be emailed a random password,
which they can then use to log in for the first time. <p>

<form name="form1" method="POST" action="createUser.php">
<p><table border='0' width='415' cellpadding='2'>
<tr>
<td width='115'>UserID:</td>
<td width='300'><input type="text" name="txtUserID" value="<?echo $strUserID;?>" size="20" maxlength="20"></td>
</tr>
<tr>
<td width='115'>First Name:</td>
<td width='300'><input type="text" name="txtFirstName" value="<?echo $strFirstName;?>" size="40" maxlength="40"></td>
</tr>
<tr>
<td width='115'>Middle Initial:</td>
<td width='300'><input type="text" name="txtMiddleInit" value="<?echo $strMiddleInit;?>" size="1" maxlength="1"></td>
</tr>
<tr>
<td width='115'>Last Name:</td>
<td width='300'><input type="text" name="txtLastName" value="<?echo $strLastName;?>" size="40" maxlength="40"></td>
</tr>
<tr>
<td width='115'>Email:</td>
<td width='300'><input type="text" name="txtEmail" value="<?echo $strEmail;?>" size="40" maxlength="50"></td>
</tr>
<tr>
<td width='115'>Department:</td>
<td width='300'>
<select name='cboAbteilung'>
<? $res= mysql-query("SELECT * FROM Abteilung");?>
<? while($row = mysql_fetch_array($res))?>
{
<? echo"<option value='$row[id_abteilung]' >$row[$name]</option>"?>}
</select>
</td>
</tr>

</table><p>

<? If (!$addSuccessful) { ?>
<input type="submit" value="Submit" name="btnSubmit">
<input type="reset" value="Reset" name="reset">
<? } ?>
</form>

<?
Include("../includes/footer.inc.php");
?>

 
joschua
30-07-2002, 22:47 
 
die while schleife wird gar nicht asgeführt....

achte darauf das das "{" zwischen <?php und ?> steht

 
joschua
30-07-2002, 22:49 
 
und vergiss in der while schleife nach dem echo das ";" nicht!

<? echo"<option value='$row[id_abteilung]' >$row[$name]</option>"; }?>

- -

Alle Zeitangaben in WEZ +2. Es ist jetzt 21:27 Uhr.