Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > PHP Databases
PHP Databases Using PHP in conjunction with databases. PHP questions not specific to databases should be directed to one of the other PHP forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old August 17th, 2011, 12:28 PM
Registered User
Join Date: Aug 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default PHP code for login with different subpages

I would like to ask for help with PHP code for login. I need that user who is already loged in was redirected with his parameter TOWN, which has this user in mysql dtb to the subpage town.php. I am sorry I am beginner with PHP :-).
After log in Mrkva will go to A.php and Slana to B.php. Thank you very much.

-table in Mysql dtb

surname pass town
Mrkva 123 A
Slana 456 B



$dbhost= 'localhost';
$dbuser= 'root';
$dbpassword= '';

mysql_connect($dbhost,$dbuser,$dbpassword) or die("cannot connect");
mysql_select_db($db) or die("cannot select DB");

$surname = $_POST['surname'];
$pass = $_POST['pass'];

$sql="SELECT * FROM $tbl WHERE surname='$surname' and pass='$pass' ";
$count=mysql_num_rows($result) ;



else {



Similar Threads
Thread Thread Starter Forum Replies Last Post
php login code problem ravi951 PHP How-To 0 August 12th, 2011 02:06 AM
Creating a login page in PHP bhavna General .NET 0 February 16th, 2007 07:32 AM
PHP Login script problem columbo1977 Beginning PHP 1 May 21st, 2006 10:47 PM
No login with auth_user.php stefanocinfo BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 0 September 10th, 2005 03:34 AM
Php login session problem programmer Beginning PHP 1 August 3rd, 2004 03:57 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.