homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

PHP Redirect
PHP redirects to specified page if username and password correct

Msg#: 4544365 posted 9:37 pm on Feb 10, 2013 (gmt 0)

When a user logs in onto my site, the form checks against the database using check.php. But I need it to check the information against the database then, if the information (username and password) is correct, redirects them to the homepage, but if they have not supplied the correct information, doesn't redirect them. Is this possible? If so can you provide me with a PHP Script. I've tried javascript redirect, header redirect and meta redirect but dreamweaver says that there is an error in the syntax on that specific line.



WebmasterWorld Administrator jatar_k us a WebmasterWorld Top Contributor of All Time 10+ Year Member

Msg#: 4544365 posted 3:00 am on Feb 12, 2013 (gmt 0)

Welcome to WebmasterWorld jsrip2012,

you could do that, just use header() [php.net] if their information is correct, otherwise I would output the login page again with whatever error was encountered.

just watch out to not have any output to the browser before using header(), even blank lines at the top of the file.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved