-2

ユーザーを LDAP ディレクトリに追加する php スクリプトに次のコードを追加しました。次に、変更をログに記録する必要があります。しかし、コードを実行すると、タイトルにエラーが表示されます。

$myFile = "newuser.log";
$fh = fopen($myFile, 'a') or die("can't open file");
$userInfo = $newUser['lastname'], $newUser['firstname'], $newUs$
fwrite($fh, $userInfo);
fclose($fh);
4

2 に答える 2

3

The culprit, as far as I can see (since I don't see line numbers) is:

$userInfo = $newUser['lastname'], $newUser['firstname'], $newUs$

If you want to concatenate your array keys into one single variable, you have to use the "." operator. So it would be:

$userInfo = $newUser['lastname']  . ', ' . $newUser['firstname'] . ', ' . $newUs;

Also, you might want to check the end of that line ($newUs$) since that will end up in another syntax error (both $'s and the missing ;)

于 2012-10-11T21:13:23.743 に答える