DeveloperCube - Sme problem...
Bad Boy Blog, an unofficial Diddy and Bad Boy fan blog
Username:    Password:
Remember Me?    
Sme problem...

 
Post new topic   Reply to topic    DeveloperCube Forum Index -> Scripts and Programming
 See a User Guidelines violation? Please contact us.
Author Message

Joël0

Joined: 08 Mar 2004
Posts: 6
Location: 't Stad

PostPosted: 3/8/2004, 4:56 am    Post subject: Sme problem... Reply with quote

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) &amp;&amp; ( $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) &amp;&amp; ( $PHP_AUTH_PW == "$wachtwoord" )) ) {
?>

Thanks.
Back to top

Matt

Joined: 30 Jan 2004
Posts: 22
Location: University of East Anglia

PostPosted: 3/8/2004, 2:38 pm    Post subject: Reply with quote

im not sure wether its just where its been parsed, but shouldnt that "&amp;" 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

PostPosted: 3/8/2004, 5:14 pm    Post subject: Reply with quote

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... Confused
Back to top

komputor

Joined: 10 Apr 2003
Posts: 17
Location: abita springs, la

PostPosted: 3/10/2004, 10:04 pm    Post subject: Reply with quote

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

PostPosted: 3/13/2004, 7:14 pm    Post subject: Reply with quote

Thanks Komputer, that helped Smile
_________________
PhpDesigners
Back to top
Display posts from previous:   
Post new topic   Reply to topic    DeveloperCube Forum Index -> Scripts and Programming All times are GMT
Page 1 of 1
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Links: Programming Forum - Art Schools Online

Network: iFroggy Network Blog - iFroggy Hosting - SportsForums.net - KarateForums.com - YanksBlog.com - phpBBHacks.com - PhotoshopForums.com - Managing Online Forums - ManagingCommunities.com - CommunityAdmins.com - DrGregHouse.com - Bad Boy Blog - BadBoyForums.com - SodaRatings.com - Patrick O'Keefe

We Support phpBBHacks.com. Forum Icons by Daz. Privacy Policy. Powered by phpBB © phpBB Group. phpBB SEO.
Copyright © 2003-2008. DeveloperCube, iFroggy Network. All Rights Reserved.

Advertising   Contact   Links   Link To Us   Staff   User Guidelines