|
| Author |
Message |
Joël0
Joined: 08 Mar 2004
Posts: 6
Location: 't Stad
|
Posted: 3/8/2004, 4:56 am Post subject: Sme problem... |
|
|
Hi, i got i little problem with the code below, i dont know whats wrong but i keep getting parse error on line 11, heres the code:
| Code: |
<?
$gebruikersnaam = "gebruikersnaam";
$wachtwoord = "wachtwoord";
$fout = "Je bent niet gemachtigd om deze pagina te bekijken!";
$name = basename ($PHP_SELF);
if ( (!isset($PHP_AUTH_USER)) || ! (($PHP_AUTH_USER == $gebruikersnaam) && ( $PHP_AUTH_PW == "$wachtwoord" )) ) {
header("WWW-Authenticate: Basic entrer=\"Form2txt admin\"");
header("HTTP/1.0 401 Unauthorized");
echo "$fout";
exit;
}
/* On line 11 is the following piece of code */
if ( (!isset($PHP_AUTH_USER)) || ! (($PHP_AUTH_USER == $gebruikersnaam) && ( $PHP_AUTH_PW == "$wachtwoord" )) ) {
?>
|
Thanks. |
|
| Back to top |
|
 |
Matt
Joined: 30 Jan 2004
Posts: 22
Location: University of East Anglia
|
Posted: 3/8/2004, 2:38 pm Post subject: |
|
|
im not sure wether its just where its been parsed, but shouldnt that "&" be "&" and does the variables need to be enclosed in quotations (like $gebruikersnaam, $wachtwoord). Also, make sure you enclosed both sides of the OR statement in brackets, including the '!' NOT operator. _________________ Matthew Abbott
- Developer
- PW New Media
- Chandler: "Now you understand how I feel every day. The world is my lesbian wedding" |
|
| Back to top |
|
 |
Joël0
Joined: 08 Mar 2004
Posts: 6
Location: 't Stad
|
Posted: 3/8/2004, 5:14 pm Post subject: |
|
|
I've tried many ways of doing this, including what you've said but they didnt worked...i dont know whats wrong, i used this code many times and now it gives me errors...  |
|
| Back to top |
|
 |
komputor
Joined: 10 Apr 2003
Posts: 17
Location: abita springs, la
|
Posted: 3/10/2004, 10:04 pm Post subject: |
|
|
if ( !isset($PHP_AUTH_USER) || $PHP_AUTH_USER != $gebruikersnaam && $PHP_AUTH_PW == $wachtwoord ) {
don't know why you would use this sort of condition, though.. seems kind of backwards
perhaps this instead -
if ( !isset($PHP_AUTH_USER) || $PHP_AUTH_USER != $gebruikersnaam || $PHP_AUTH_PW != $wachtwoord ) { |
|
| Back to top |
|
 |
Joël0
Joined: 08 Mar 2004
Posts: 6
Location: 't Stad
|
Posted: 3/13/2004, 7:14 pm Post subject: |
|
|
Thanks Komputer, that helped  _________________ PhpDesigners |
|
| Back to top |
|
 |
|