Page 1 of 1

log in php code page

Posted: Sun Dec 14, 2008 11:37 am
by mtb211
Hi All,

I just joined the forum

We have a php web page and we also have a database for all the customers already

I want to create a very simple log in page that has only a user name and password field
and an image

Each username has an individual link via the IE or Firefox default log in

instead of having this I would like to make it possible when the name is entered it will automatically send the user to correct folder

On the internet I can only find these complex third party coding which I dont really need.

Any suggestions?

Matt

Re: log in php code page

Posted: Sun Dec 14, 2008 12:28 pm
by watson516
If I understand you correctly, you want to redirect the user after login?

Code: Select all

<?php
//Code for login -> no output
header('Location: panel.php');
?>

Re: log in php code page

Posted: Sun Dec 14, 2008 2:31 pm
by NoorAdiga
well ... I think u didn't explain ur idea clearly , but according to what I understood

u need first to check if the user name and password r correct and if yes then u will send the user to a unique page for each user .... can I ask u then ... that unique page, what it's url ?
and how its generated ....
I will use 2 assumptions

First: this URL is stored in the data base,
then what u need to do is to check the user name and password then if they are true ... then retrieve the date from ur database .... and add the statement header('Location: url.php');
but be aware not to output any data before using this ....

Second: the url is generated using any information from the user like his user name
lets say the page will be http://mysite/user_name
$string_url = "http://mysite/.$user_name";
header( "Location: $string");

I hope this was helpful for u Matt :)