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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.