log in php code page

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mtb211
Forum Newbie
Posts: 15
Joined: Sun Dec 14, 2008 11:32 am

log in php code page

Post 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
watson516
Forum Contributor
Posts: 198
Joined: Mon Mar 20, 2006 9:19 pm
Location: Hamilton, Ontario

Re: log in php code page

Post 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');
?>
NoorAdiga
Forum Newbie
Posts: 5
Joined: Thu Dec 11, 2008 6:10 pm

Re: log in php code page

Post 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 :)
Post Reply