Username/Password access to web pages

Discussion in 'Software' started by secretcodebreaker, Oct 18, 2006.

  1. secretcodebreaker

    secretcodebreaker Specialist

    I'm not a programmer, although I used to write simple QBasic programs long ago when I wore a younger man's clothes.

    I do a little maintnence and make small changes to my web pages by cutting and pasting, trial and error.

    A few days ago, I went to a web site that asked me, with a prompt window that popped up, for a Username and Password.

    Is it very difficult to add that feature to a web page HTML code?

    I was thinking about using that to allow someone to download pdf files and zip files of my books and the programs that go with them, by logging onto a download web page.

    They would pay me via PayPal via my current web site, as they do now for actual copies of my books that I ship to them (I added that function last year with code that PayPal sent me). When I received the e-mail from PayPal notifying me of that payment, instead of mailing out a copy of my book I would e-mail the payee a Username and Password that would be good for a limited time along with the URL for the download page that would require this log-in.

    Also, would it be difficult to automate that entire process, eliminating the need for me to e-mail the Username and Password and upload that information (and later remove) that it from the web site server.

    When someone has the time and inclination, could you explain to me, in simple terms, how this would be done?

    Or maybe direct me to a place that provides free routines, in cut and paste form, that I might try.

    Thanks
     
  2. Mada_Milty

    Mada_Milty MajorGeek

    Difficult to prompt for username and password? No.
    Difficult to do securely? Yeah, a little

    Prompting for username and password via javascript is simple, but requires that the passwords be hard coded into the page, so anyone who knows enough to look at the page's source code can see the passwords clearly.

    You can do it dynamically on the server's side, but this requires a PHP installation, or ASP pages, which is quite a bit more difficult. This requres a webserver properly setup with support for one of these languages, and a database to connect the website to. A popular choice of db is MySQL, as it is open source.

    On the bright side, yes it is possible to automate the entire process. This requires that the webserver be set up with a SMTP component that can send out email.
     
  3. secretcodebreaker

    secretcodebreaker Specialist

    Right now on the web site I have a PHP file that a friend wrote for me that performs a CHAPTA like routine for controlling access to my free downloads. I assume that means the server supports PHP.

    Also, on my cPanel, there is a icon that is labeled MySQL Databases.

    The e-mail address I have in my profile and used by this forum to send me e-mails is routed through the web site server. Is that an indication that the server has an SMTP component?

    If all of this is true, is this just a matter of programming?

    And if it is just a matter of programming, could you estimate what the probable cost would be to have that script written?

    Thanks
     
  4. Mada_Milty

    Mada_Milty MajorGeek

    Seems like a safe enough assumption. Is this a webserver of your own, or remotely hosted?

    This is the control panel of the server? Or your local machine?

    This seems to confirm my suspicion that you have physical access to the web server. What software is the webserver running? Apache? IIS? Here's how we check for the SMTP component for a webserver running IIS:

    1. Open Add/Remove Programs
    2. Hit alt + w (or click 'Add/Remove Windows Components')
    3. Select 'Internet Information Services'
    4. Hit the 'Details' button

    Here, we will see a listing of the components of IIS. If Simple Mail Transfer Protocol is checked, then SMTP is installed on the webserver.

    If you do have all these things, it is just a matter of programming. This is fairly simple to implement... I'm not going to quote prices, but what will need to be done is easy to outline:

    1. We will need a new table in the database to store username and passwords. This can be created with a simple SQL statement or by the wonderful administrative tool PHPMyadmin. This freeware tool give a easy-to-use GUI for creating and issuing SQL commands. You might get off with NO cost there.

    2. You will need to connect the page to the database. This should be a one line command, IIRC.

    3. The PHP script will need to query the DB based on what's entered in the username field. This is a simple validation procedure. If the entered password matches the stored password, direct them to the (download?) page...if not, regenerate the login page with a warning... (if desired)

    None of these steps in themselves are too difficult. If you have the required tools, setting up the page shouldn't take too much time or effort. IF you're interested, I recommend reading this article on connecting to a MySQL database with PHP.
     
  5. secretcodebreaker

    secretcodebreaker Specialist

    Remotely hosted. I have no idea who owns the server. I think it is physically located in Philadelphia and the person I pay for the space and bandwidth on the server lives in Rochester.

    Here is the data on the server.

    =============================
    General server information:
    Operating system Linux
    Service Status Click to View
    Kernel version 2.6.9-022stab078.20-enterprise
    Machine Type i686
    Apache version 1.3.36 (Unix)
    PERL version 5.8.7
    Path to PERL /usr/bin/perl
    Path to sendmail /usr/sbin/sendmail
    Installed Perl Modules Click to View
    PHP version 4.4.4
    MySQL version 4.1.21-standard
    cPanel Build 10.9.0-RELEASE 47
    Theme cPanel X v2.6.0
    ====================================
    Can't find an Add/Remove Programs to Open. Don't even know where to look.

    I have an IPSwitch program that provides me with a GUI for uploading files to the folders on the server.

    I only (know how to) use the cPanel to look at AWStats and Add/Remove e-mail addresses and passwords.

    I empty the secretcodebreaker.com Inbox with Thunderbird.

    I send out e-mails from the secretcodebreaker.com address via my ISP (Localnet).

    I appreciate your taking the time to do the outline and suggesting a course of action. However, I think most of that is beyond me and I'm probably too old to learn.

    One of the 'problems' with trying to do it myself is that the final product has to be 100% correct, even 99% isn't good enough when it comes to creating (writing) a program that works. :)

    So, if I'm going to do this, someone else will have to do the programming.

    Could you (or anyone that's interested) e-mail or PM me an estimate of the cost? I need that to determine if this 'project' is going to be cost prohibitive and I don't think it is fair to you to take your time and knowledge discussing it, if it is beyond the reach of my pocketbook.

    Thanks
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds