Security and Cryptography
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationSecurity and Cryptography

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 27th, 2000, 07:09 PM
craig34's Avatar
craig34 craig34 is offline
Webmaster Extraordinaire
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2000
Location: Woburn, MA
Posts: 126 craig34 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 18 m 39 sec
Reputation Power: 9
I am making a site that requires user authentication. It checks a database for the users username and password and only lets them in if they match. Apparently, my client is using a Mac, and she claims that she cannot log in to the site on that computer. She has a power MAC 7200/90 with system software of 7.5. She has Netscape
3.0. I am wondering if this problem is related to her Mac. My code is below. Thanks for any help.
Craig Anderson
Intrepid Web Site Development
canderson@intrepidwsd.com

<?php
if (!isset($PHP_AUTH_USER)) {

header('WWW-Authenticate: Basic realm="My Private Stuff"');
header('HTTP/1.0 401 Unauthorized');
exit;

} else if (isset($PHP_AUTH_USER)) {


mysql_connect("hostname", "username", "password")

or die ("Unable to connect to database.");


mysql_select_db("dev_i2ii_com")
or die ("Unable to select database.");

$sql = "SELECT *
FROM users
WHERE username='$PHP_AUTH_USER' and password='$PHP_AUTH_PW'";


$result = mysql_query($sql);


$num = mysql_numrows($result);

if ($num != "0") {
echo "<P>You're authorized!</p>";
exit;

} else {

header('WWW-Authenticate: Basic realm="My Private Stuff"');
header('HTTP/1.0 401 Unauthorized');
echo 'Authorization Required.';
exit;

}

}

?>


Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationSecurity and Cryptography > Authentication on Mac?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway