Go Back   Website Hosting - VPS Hosting - Domain Registration Ireland :: Blacknight > Technical Support > Shared Linux / Windows Hosting

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-11-08, 03:54 PM
Junior Member
 
Join Date: Nov 2008
Posts: 2
Default Access question

Hi! I try to put passwork on my web page. but i think host(couse of security ) dont let me do that.

i down load scr for pass on admin page

here it is
<?php
include("blocks/bd.php");
if (!isset($_SERVER['PHP_AUTH_USER']))

{
Header ("WWW-Authenticate: Basic realm=\"Admin Page\"");
Header ("HTTP/1.0 401 Unauthorized");
exit();
}

else {
if (!get_magic_quotes_gpc()) {
$_SERVER['PHP_AUTH_USER'] = mysql_escape_string($_SERVER['PHP_AUTH_USER']);
$_SERVER['PHP_AUTH_PW'] = mysql_escape_string($_SERVER['PHP_AUTH_PW']);
}

$query = "SELECT pass FROM userlist WHERE user='".$_SERVER['PHP_AUTH_USER']."'";
$lst = @mysql_query($query);

if (!$lst)
{
Header ("WWW-Authenticate: Basic realm=\"Admin Page\"");
Header ("HTTP/1.0 401 Unauthorized");
exit();
}

if (mysql_num_rows($lst) == 0)
{
Header ("WWW-Authenticate: Basic realm=\"Admin Page\"");
Header ("HTTP/1.0 401 Unauthorized");
exit();
}

$pass = @mysql_fetch_array($lst);
if ($_SERVER['PHP_AUTH_PW']!= $pass['pass'])
{
Header ("WWW-Authenticate: Basic realm=\"Admin Page\"");
Header ("HTTP/1.0 401 Unauthorized");
exit();
}


}




?>



its working correct on my local host .... but on black magic its working too,
but the password witch one is on userlist (in my date basse) do not match...

what i`m have to change?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 08-11-08, 04:55 PM
Administrator
Site Admin
 
Join Date: Aug 2003
Location: Ireland
Posts: 406
Send a message via ICQ to blacknight Send a message via AIM to blacknight Send a message via MSN to blacknight Send a message via Skype™ to blacknight
Default

This looks like it's a coding issue, which is not something we would provide support for.
I'd recommend posting on a coding forum for assistance.

You could try over here:
Webmaster Help - Coding Help at IrishWebmasterForum.com
__________________
Please do not send me PMs for support issues - thanks for your understanding.
Blacknight Blog | VPS Hosting| Blacknight Technical Status Blog | Speed Test|Webmaster Chat |Personal Blog
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Tags
access, question

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:33 PM.


VPS Hosting Web Hosting Ireland Blacknight Blog Blacknight Status

Powered by: vBulletin Version 3.7.3, Copyright ©2000 - 2009, Jelsoft Enterprises Limited.
Blacknight 2005 - 2008 | VPS Hosting

SEO by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17