LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   MySQl account login, PHP (https://www.linuxquestions.org/questions/programming-9/mysql-account-login-php-205811/)

agallant 07-16-2004 08:41 AM

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?

keefaz 07-16-2004 10:44 AM

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

agallant 07-16-2004 11:01 AM

Hey,

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.

-AG


All times are GMT -5. The time now is 03:39 AM.