Browser siger:
Warning: Undefined variable: PHP_AUTH_USER in c:\apache
webserver\apache\htdocs\nntpweb\nntpweb\settings.php on line 16
Warning: Undefined variable: l46 in c:\apache
webserver\apache\htdocs\nntpweb\nntpweb\settings.php on line 9
Warning: Cannot add header information - headers already sent by
(output
started at c:\apache
webserver\apache\htdocs\nntpweb\nntpweb\settings.php:16) in
c:\apache
webserver\apache\htdocs\nntpweb\nntpweb\settings.php on line 9
Warning: Cannot add header information - headers already sent by
(output
started at c:\apache
webserver\apache\htdocs\nntpweb\nntpweb\settings.php:16) in
c:\apache
webserver\apache\htdocs\nntpweb\nntpweb\settings.php on line 10
Forbidden.
I filen står:
<?php
require("./functions.php");
function authHeaders() {
global $l45;
header("WWW-Authenticate: Basic realm=\"$l46\"");
header("HTTP/1.0 401 Unauthorized");
echo $l45;
exit;
}
if ($PHP_AUTH_USER != $adminUser || crypt($PHP_AUTH_PW, "s") !=
$adminPassword) {
authHeaders();
}
pageHeader();
dbConnect();
if ($submitSettings) {
if (!$setUser || !$setNntpHost || !$setSqlHost ||
!$setSqlDatabase) {
error($l34);
}
$passwordContents = ($newPassword) ? crypt($setPassword, "s") :
$adminPassword;
$fileContents = "<?php\n";
$fileContents .= "\$language = \"$setLanguage\";\n";
$fileContents .= "\$adminUser = \"$setUser\";\n";
$fileContents .= "\$adminPassword = '$passwordContents';\n";
$fileContents .= "\$nntpHost = \"$setNntpHost\";\n";
$fileContents .= "\$nntpPort = \"$setNntpPort\";\n";
$fileContents .= "\$sqlHost = \"$setSqlHost\";\n";
$fileContents .= "\$sqlUser = \"$setSqlUser\";\n";
$fileContents .= "\$sqlPassword = \"$setSqlPassword\";\n";
$fileContents .= "\$sqlDatabase = \"$setSqlDatabase\";\n";
$fileContents .= "?>";
$writeFp = fopen("./settingsSaved.php", "w") or error($l35);
fwrite($writeFp, $fileContents);
echo "$l36<br/><br/>\n";
echo "<a href='javascript:history.back()'>$l3</a>\n";
pageFooter();
exit;
}
if ($addGroup) {
if (!ereg("^[a-zA-Z0-9.+-]+$", $addGroup)) error($l22);
$groupSql = noSpecialChars($addGroup);
# Testing if the group is already on the list of subscribed
# groups:
$query = mysql_query("select newsgroup from subscribed where
newsgroup =
'".addslashes($addGroup)."'") or error("$l6
<i>".mysql_error()."</i>");
if (mysql_num_rows($query) > 0) error($l20);
# Notice the varchar definition of the reference column: It's
# only 252 characters. That's because MySQL won't allow indexes
# on varchars with more than 252 characters.
mysql_query("create table $groupSql (
id int not null auto_increment,
messageId varchar(255),
reference varchar(252) not null,
date datetime,
sender varchar(255),
subject varchar(255),
primary key (
id
),
index (
reference
)
)") or error("$l6 <i>".mysql_error()."</i>");
mysql_query("insert into subscribed (
newsgroup
)
values (
'".addslashes($addGroup)."'
)") or error("$l6 <i>".mysql_error()."</i>");
}
if ($deleteGroup) {
for ($i = 0; $i < sizeof($deleteGroup); $i++) {
mysql_query("drop table
".addslashes(noSpecialChars($deleteGroup[$i]))."")
or error("$l6 <i>".mysql_error()."</i>");
mysql_query("delete from subscribed where newsgroup =
'".addslashes($deleteGroup[$i])."'") or error("$l6
<i>".mysql_error()."</i>");
}
}
echo "<hr noshade='noshade'>\n";
echo "<span class='bigger'>$l24</span><br/><br/>\n";
echo "<form action='$PHP_SELF' method='post'>\n";
echo "<table $tableAttributes>\n";
echo "<tr>\n";
echo "<td>$l33</td>\n";
echo "<td>\n";
echo "<select name='setLanguage'>\n";
$handle = opendir("./languageFiles");
while ($file = readdir($handle)) {
if (is_dir($file)) continue;
# Removing the file extension:
$thisLanguage = substr($file, 0, strrpos($file, "."));
printf("<option
value='$thisLanguage'%s>$thisLanguage</option>\n",
($language == $thisLanguage) ? " selected='selected'" : "");
}
echo "</select>\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td>$l31</td>\n";
echo "<td><input type='text' name='setUser'
value='$adminUser'/></td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td>$l32</td>\n";
echo "<td>\n";
echo "<input type='radio' name='newPassword' value='0'
checked='checked'
onclick='this.form.setPassword.disabled = true'/> $l43<br/>\n";
echo "<input type='radio' name='newPassword' value='1'
onclick='this.form.setPassword.disabled = false;
this.form.setPassword.focus()'/> $l44<br/>\n";
echo "<input type='password' name='setPassword'
disabled='disabled'/>\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td>$l29</td>\n";
echo "<td><input type='text' name='setNntpHost'
value='$nntpHost'/></td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td>$l30</td>\n";
printf("<td><input type='text' name='setNntpPort'
value='%s'/></td>\n",
($nntpPort) ? $nntpPort : 119);
echo "</tr>\n";
echo "<tr>\n";
echo "<td>$l25</td>\n";
printf("<td><input type='text' name='setSqlHost'
value='%s'/></td>\n",
($sqlHost) ? $sqlHost : "localhost");
echo "</tr>\n";
echo "<tr>\n";
echo "<td>$l26</td>\n";
echo "<td><input type='text' name='setSqlUser'
value='$sqlUser'/></td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td>$l27</td>\n";
echo "<td><input type='password' name='setSqlPassword'
value='$sqlPassword'/></td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td>$l28</td>\n";
echo "<td><input type='text' name='setSqlDatabase'
value='$sqlDatabase'/></td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td></td>\n";
echo "<td><input type='submit' name='submitSettings' value='$l19'
class='button'/></td>\n";
echo "</tr>\n";
echo "</table>\n";
echo "</form>\n";
echo "<hr noshade='noshade'>\n";
echo "<span class='bigger'>$l23</span><br/><br/>\n";
echo "<script type='text/javascript'>\n";
echo "function confirmDeleteGroup() {\n";
echo " return (confirm(\"$l21\")) ? true : false;\n";
echo "}\n";
echo "</script>\n";
echo "<form action='$PHP_SELF' method='post'>\n";
echo "$l17<br/>\n";
echo "<input type='text' name='addGroup'/><br/>\n";
echo "<input type='submit' value='$l19' class='button'/>\n";
echo "</form><br/><br/>\n";
echo "<form action='$PHP_SELF' id='formDeleteGroup' method='post'
onsubmit='return confirmDeleteGroup()'>\n";
echo "$l18<br/>\n";
echo "<select name='deleteGroup[]' size='5'
multiple='multiple'>\n";
showSubscribed();
echo "</select><br/>\n";
echo "<input type='submit' name='submitDeleteGroup' value='$l19'
class='button'/>\n";
echo "</form>\n";
pageFooter();
?>
Hvad er der galt??
Svar venligst per e-mail, men ellers her i i gruppen.
På forhånd tak
Mvh Bertel Torp
the@webhiker.dk
Ps. Beoplayer er et flop (
www.beoplayer.com) men jeg bruger det
aligevel!
--
Vil du lære at kode HTML, XHTML, CSS, SSI eller ASP ???
- Pædagogiske tutorials på dansk
- Kom godt i gang med koderne
KLIK HER! =>
http://www.html.dk/tutorials