PHP Coding
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP RelatedPHP Coding

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 Codewalkers Forums Sponsor:
AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th-1:00PM EST. Register Today!
  #1  
Old September 6th, 2002, 01:02 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
Directory Protection

I can login to various directorys by putting the line below as the beggining line in the index.php of various directories, and so a user can login, i.e each directory has its own username and passwd.
this is the line

<?php
require '/path/to/_restrict.php';
?>
and the user will login.

But now what I want is to have amain page whereby all users access one page and each user is directed to his/her directory or page

so I create login.php
and I made it like this
<?php

require'/usr/local/apache/htdocs/users/_restrict.php';
if (isset($_SESSION['psaun'])) {
header ('Location: http://server.com/'.$SESSION['psaun']);
exit;
}
?>

Also,
When I put this line :
<?php echo '<pre>'; print_r($_SESSION); echo '</pre>'; ?>
in my directory index file, i.e index.html, where am able to login, I get the results as below, if it could shed more light.

Array
(
[psaun] => meric
[remote] => 213.177.x.x
[psag] => 100003
[psau] => 2
however from my login.php. I still fail to login with an error message of access restricted for that directory ,can someone p;se help me
thanx

Reply With Quote
  #2  
Old September 6th, 2002, 02:07 PM
meric_l meric_l is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 1 meric_l User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: RE: Directory Protection

Tried it but its also not working...


Thanx

Eric
Quote:
I think you have to call session_start(); from every script.


Reply With Quote
  #3  
Old September 8th, 2002, 03:19 PM
sethadam1 sethadam1 is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Orlando, FL
Posts: 223 sethadam1 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: Directory Protection

check this thread out and see if it helps.

http://codewalkers.com/forum/index.php?action=displaythread&forum=phpcoding&id=319&realm=default

Reply With Quote
  #4  
Old September 8th, 2002, 03:41 PM
Nimco Nimco is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 132 Nimco User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via AIM to Nimco
RE: Directory Protection

You could always just try .htaccess and .htpasswd if you can't find an easier way.

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Coding > Directory Protection


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 6 hosted by Hostway