Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 7 of 7
  1. #1
    ish
    ish is offline
    Junior Member
    Join Date
    Jan 2015
    Posts
    4
    Member #
    41243

    .php files and .htaccess (Beginner question)

    I have installed a php library for use on a project, and it strongly recommended .htaccess protection for the folder it was contained it. Ok, great, I get it set up, and it (.htaccess/.htpasswd) works ... on files and folders included, except for .php files. For these, my login/password don't work, and I get a 401 error. My Google-fu is failing me, and I'm not able to find out why. Do you know what I'm missing?

  2.  

  3. #2
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,693
    Member #
    5580
    Liked
    717 times
    Duplicate everything in a "non-protected" folder and see if it works.

    That would answer the question of whether your "strongly recommended security" is causing the problem.

    If you still get the 401 error, you'll know it's a scripting error.

    By the way, what is the PHP library that recommended the protection?


  4. #3
    ish
    ish is offline
    Junior Member
    Join Date
    Jan 2015
    Posts
    4
    Member #
    41243
    The library was PEAR. Thank-you for your quick response (I'll give it a try in the morning! )

  5. #4
    ish
    ish is offline
    Junior Member
    Join Date
    Jan 2015
    Posts
    4
    Member #
    41243
    Alright, so I've installed PEAR in different directories, and it works before adding .htaccess protection, and only after adding htaccess protection does it give me a 401 message on php files. I think I'm going to start over with a completely different method, because this is just not happening.

  6. #5
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,693
    Member #
    5580
    Liked
    717 times
    I'm not a PEAR expert.

    You might want to find a forum that specializes in PEAR and ask the same question.

    Maybe that .htaccess security is not necessary? I don't know.

    Can you describe what your goal is? What your website will be doing?


  7. #6
    ish
    ish is offline
    Junior Member
    Join Date
    Jan 2015
    Posts
    4
    Member #
    41243
    On PEAR: unfortunately PEAR resources seem to not be very active. Which is definitely one reason to avoid them given my current understanding.

    I'm trying to use a form to email files, and I've been trying to adapt this example to my needs. Potentially though, I may not need that, and my current goal is to take the validation process (file size and type) from that example, and maybe use this 'simpler' idea.

  8. #7
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,693
    Member #
    5580
    Liked
    717 times
    For the form itself with validation, use a free JQuery form.
    The actual email itself would then be a PHP script.

    To mix it all together, you could use PHP w/AJAX.
    AJAX would be the javascript and PHP put together.

    This would be one of many examples:
    Ajax Contact Form with an Attachment (jQuery & PHP)

    That allows a file to be selected and attached to the email.

    No need to worry about security. Email is never secure, so it doesn't matter.



Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 11:23 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com