kickassamd Posted March 1, 2007 Share Posted March 1, 2007 Is it possible to have PHP send login \ password to a form processor to test if the login is valid?? Instead of me manually doing each one?? I know there are programs but this is a learning experience for me and also software isnt free Quote Link to comment https://forums.phpfreaks.com/topic/40624-php-can-it-do-this/ Share on other sites More sharing options...
pocobueno1388 Posted March 1, 2007 Share Posted March 1, 2007 Yes, easily. I would assume you were storing the usernames and passwords in a database. <?php $username = $_POST['username']; $pass = $_POST['pass']; $query = mysql_query("SELECT col1, col2, col3 FROM users WHERE username='$username' AND password = '$password'"); if (mysql_num_rows($query) < 1){ echo "Wrong username/password combination"; } else { echo "Your username and password is correct!"; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/40624-php-can-it-do-this/#findComment-196487 Share on other sites More sharing options...
kickassamd Posted March 1, 2007 Author Share Posted March 1, 2007 No no not that... I can send form variables to PHP... Im asking if PHP can send variables to a form and check if they are valid.... Quote Link to comment https://forums.phpfreaks.com/topic/40624-php-can-it-do-this/#findComment-196492 Share on other sites More sharing options...
pocobueno1388 Posted March 1, 2007 Share Posted March 1, 2007 Sorry...I don't understand. Quote Link to comment https://forums.phpfreaks.com/topic/40624-php-can-it-do-this/#findComment-196493 Share on other sites More sharing options...
kickassamd Posted March 1, 2007 Author Share Posted March 1, 2007 I want to give PHP a series of username \ password combinations and have it "login for me" without me filling out the form with each one... I just want PHP to automate testing the username \ password... Quote Link to comment https://forums.phpfreaks.com/topic/40624-php-can-it-do-this/#findComment-196494 Share on other sites More sharing options...
fert Posted March 1, 2007 Share Posted March 1, 2007 look into cURL Quote Link to comment https://forums.phpfreaks.com/topic/40624-php-can-it-do-this/#findComment-196496 Share on other sites More sharing options...
pocobueno1388 Posted March 1, 2007 Share Posted March 1, 2007 Oh, I see what you mean. Like fert said, cURL is the way to go. Quote Link to comment https://forums.phpfreaks.com/topic/40624-php-can-it-do-this/#findComment-196512 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.