Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 07-16-2004, 08:41 AM   #1
Registered: Oct 2003
Location: D.C USA
Distribution: Redhat 9. Thinking about Slackware
Posts: 166

Rep: Reputation: 30
MySQl account login, PHP

Ok i have a section on my website tat allows users to login and edit there information. currently it is only sing the login field to access the users information. Does any one know how to use the login and password fields at the same time. also does any one know how to do an auto redirect with php?
Old 07-16-2004, 10:44 AM   #2
LQ Guru
Registered: Mar 2004
Distribution: Slackware
Posts: 5,388

Rep: Reputation: 408Reputation: 408Reputation: 408Reputation: 408Reputation: 408
The redirection is simple (take care to use it before output something)
PHP Code:
header"Location: login_form.html" ); 
To use the name and password at same time it is simple too, you can do a select query like :
SELECT name, password FROM the_table WHERE name='username' AND password='pass'

If it returns a row, log is ok

Last edited by keefaz; 07-16-2004 at 10:46 AM.
Old 07-16-2004, 11:01 AM   #3
Registered: Oct 2003
Location: D.C USA
Distribution: Redhat 9. Thinking about Slackware
Posts: 166

Original Poster
Rep: Reputation: 30

Thanks for the SQL statment. That was lazyness on my part.

as for the header( "Location: login_form.html" ); that returned a message saying that there was an error in my SQL statment at line 1

What i ended up doing was using <META http-equiv="refresh" content="0; url=edit.php?search=<?php echo $row_Recordset1['id']; ?>%20" id="<?php echo $row_Recordset1['id']; ?>"> in the dynamic table.

<META http-equiv="refresh" content="0; url="> did not work unless it was in the d-table.



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help in getting my account some mysql priveledges mobo Ubuntu 1 09-17-2005 06:20 AM
Nobody Account (PHP) rootyard Programming 1 09-13-2004 01:22 PM
Problem getting PHP to recognize MySQL, Using PHP 4.0 and MySQL 4.0.20 d2army Programming 4 06-27-2004 08:54 PM
Apache Mysql Php: mysql with php doesn't work breakerfall Linux - Networking 6 12-27-2003 08:59 PM
PHP and MySQL - login elapse time Manuel-H Linux - General 0 08-08-2003 08:00 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:54 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration