Jump to content
xisto Community
GameSmith

A Twist On Basic Authentification html help

Recommended Posts

Alright, i am working on a website where a number of different users from different companies will be looking hooking into one website.What i want is to know how i can differentiate between the users based on the information passed by the webserver. I've been told to that information will be passed along html_user(and if i have a distinct user then i can just query the database with that info and get what i want)But how does this work? I am sorry i know this is cryptic i'm kind of searching to see if this strikes a bell with anyone.So to sum, many users are logging in with basic authentification, then being redirected to my page. From there i need to be able to differentiate between the users based on whatever is inherently passed.Help! As you can see i don't know this one too well... lol

Share this post


Link to post
Share on other sites

I don't understand completely what you want to do, maybe, but if I were you, i would consider that having each person register and then Log-in to the main site would be enough... IF... each person who registered could be identified by the Company they are a part of in their user Profile.In order to complete this answer, please post the Database Table schema you are using so we can assist you further.thanks.

Share this post


Link to post
Share on other sites

if you mean they are being sent to your site, from a referrer, the easiest way to sort the problem out, would be to have a user cookie sent to their browser before the referral, then checked by your site, and then the code could query the database accordingly. if the site differentiates users in the URL like "http://forums.xisto.com/no_longer_exists/ could use PHP to detect the referrer, and break down the URL, and query the database accordingly.

Share this post


Link to post
Share on other sites

So to sum, many users are logging in with basic authentification, then being redirected to my page. From there i need to be able to differentiate between the users based on whatever is inherently passed.

are you saying people are logging on to one site, and when they get redirected to yours, you want to differenciate the users/members? what's your website and where are the users coming from? from my understanding you want to differentiate the users without them having to log in to your site page? i think you need to be more specific here.... Edited by anwiii (see edit history)

Share this post


Link to post
Share on other sites

you will need to create a script with $_GET placing it in the logging page.. after this method you should put another $_GET in the website to where it is redirected so you can differentiate it..

example:

<?php$authent_type = $_GET("auth_type");?>

and you'll just add the auth_type with it's username and/or userID in the link like
http://domain.com/redirect.php?uname=username&uID=1234567&auth_type=<?php echo $authent_type; ?>

OR

you can also do it without using $_POST variable but instead creating a cookie.. setcookie() function will do the work replacing the $_POST variable and it is much easier..

example:

setcookie("user", $username, time()+3600);

where "user" is the name of the cookie, $username is it's value, and the timeline on how long it will be in the user's machine...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | 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.