BellevuePC Posted January 25, 2011 Share Posted January 25, 2011 Hello, I recently inherited my company's website from a former coworker and it's done in PHP. I'm still learning PHP so I need a little help. There's one page that our sales guy goes to to put our specials on the site and it's set to remember the username and password. I'm fine with it holding the username I just need to know how to make it ask for a password. Here is the code Actual username and password removed <?php function clean($text) { return trim(htmlspecialchars($text, ENT_QUOTES )); } class database { var $DB, $username, $database, $result, $rowNum, $lUID; function database($database, $username="*****", $password="***") { $this->DB = mysql_connect("localhost", $username, $password) // $this->DB = mysql_connect("commerce.****.org", $username, $password) or die ("Failed to connect to DB with username ".$username." error: ".mysql_error()); mysql_select_db($database, $this->DB) or die ("Can't select db ".$database." error: ".mysql_error()); This is just the top of the page, if you need more info just ask. Any help you can offer would be great, thanks. Quote Link to comment https://forums.phpfreaks.com/topic/225672-make-it-ask-for-a-password/ Share on other sites More sharing options...
requinix Posted January 25, 2011 Share Posted January 25, 2011 That bit of code has nothing to do with your issue. Somewhere there's a login form, right? Maybe has a "Remember me" checkbox? That's the code that needs to change. Quote Link to comment https://forums.phpfreaks.com/topic/225672-make-it-ask-for-a-password/#findComment-1165197 Share on other sites More sharing options...
Maq Posted January 25, 2011 Share Posted January 25, 2011 (Please use tags when posting code) Quote Link to comment https://forums.phpfreaks.com/topic/225672-make-it-ask-for-a-password/#findComment-1165203 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.