Jump to content

PHP/MySQL Login System Help (Need to redirect to directory)


realmxofxnoise

Recommended Posts

Hi Everyone,

 

First off, thanks for taking the time to look at my post.  I'm a first time user of PHPFreaks and so far it seems like a nice site.  So thanks for having me.

 

I did some searching on the forums to see if my question could have already been answered but no such luck as of yet. 

 

So, onto the question:

 

I used a script for creating a PHP/MySQL login system.  It works just fine, I'm just having a problem trying to figure out how to get it to point the user that logs in to a certain directory.  I will have a directory/area of the site that will be designated to them.  So I don't want the other users that login with their own user/pass combo to have access. 

 

So I need it to direct the person that logs in to a certain directory based on the user/pass combo.  Is this possible, and if so any help would be greatly appreciated.

 

Thank you,

 

    Nick

Link to comment
Share on other sites

have you tried using headers?

header("Location:/filespath/".$userpathspecified);

 

It might be better to display the directory area depending on what the user has assigned in their account in database. If that makes sense.

This sort of makes sense to me.  I'm fairly new with this stuff but I think I understand.  Now - would this keep things secure and prevent a user from manually entering a different user's directory location? 

 

So after they hit submit on the login system, would I just do a if/then/else statement and check the username and if $user1 just include $user1_files, etc etc? 

 

Any more help would be greatly appreciated.

 

Thank you,

 

    Nick

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.