Jump to content

Make it ask for a password


BellevuePC

Recommended Posts

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.

 

Link to comment
https://forums.phpfreaks.com/topic/225672-make-it-ask-for-a-password/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.