I'm using this code:
<?php
if(!isset($PHP_AUTH_USER)) {
Header("WWW-authenticate: basic realm=\"UPDATE_PAGE\"");
Header("HTTP/1.0 401 Unauthorized");
$title="Login Instructions";
?>
<blockquote>
MESSAGE FOR FAILED LOGIN
please contact <a href="mailto:peter@cpinews.net">Peter Forman</a>.
</blockquote>
<? php
exit;
}
else {
mysql_connect("localhost","cpinews_cpinews","******") or die("Unable to connect to SQL server");
mysql_select_db("cpinews_news") or die("Unable to select database");
$query = mysql_query("select * from users where login='$PHP_AUTH_USER' and password='$PHP_AUTH_PW'");
if(!mysql_num_rows($query)) {
Header("WWW-authenticate: basic realm=\"UPDATE_PAGE\"");
Header("HTTP/1.0 401 Unauthorized");
$title="Login Instructions";
?>
<blockquote>
MESSAGE FOR FAILED LOGIN
please contact <a href="mailto:peter@cpinews.net">Peter Forman</a>.
</blockquote>
<?
exit;
}
mysql_free_result($query);
}
?>
I get this:
Parse error: parse error in /home/cpinews/public_html/cpi/73044.php on line 31
line 31 is:
exit;
any help would be appreciated.