|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi I have inplemented some basic security which the code is below and works fine except one little flaw , The cancel button lets you in any how (okay perhaps it is big flaw)
Can some point me in the right direction? Im happy to either close the browser or redirect to another page? Any one suggest where and how i'd implement this. <?php include ('file:///F|/proj/htdocs/connection.php'); $authorized = FALSE; if((isset($_SERVER['PHP_AUTH_USER']) AND isset($_SERVER['PHP_AUTH_PW'])) ){ mysql_select_db($DB_SECURITY_NAME); $query = "SELECT username from $DB_USERS Where username ='{$_SERVER['PHP_AUTH_USER']}' and password = '{$_SERVER['PHP_AUTH_PW']}'"; //$query = "SELECT username from $DB_USERS Where username ='{$_SERVER['PHP_AUTH_USER']}' and password = PASSWORD('{$_SERVER['PHP_AUTH_PW']}')"; $result = mysql_query($query); $row = mysql_fetch_array($result); if($row){ $authorized = TRUE; } } if(!$authorized){ header('WWW-Authenticate: BASIC realm ="My Web Site"'); header('HTTP/1.0 401 Unauthorized'); } ?> Thanks & Regards D. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > simple security ! but why does cancel let you in anyhow? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|