Jump to content

Search the Community

Showing results for tags 'crypt htpasswd'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. I have a PHP file that generates a htpasswd file based on a different password each day. The part of the code that does this is shown below: <?php $clearTextPassword = $passstrings[$TodayDay]; $password = crypt($clearTextPassword, base64_encode($clearTextPassword)); $filepath = '/home/passwd'; // if the file exits, change the permissions if (file_exists($filepath)) { chmod($filepath, 0777); } // open password file to write $fp = fopen($filepath, "w"); // write today's password phrase fputs($fp, "mfsaccess01:$password\r\n"); // change permissions chmod($filepath, 0644); // close passwd file fclose($fp); echo '<h2 align="center">The password for today is the FIRST THREE WORDS found on page '.$pagenum[$TodayDay].'<br> in the MFS book (first paragraph, not title). Please do not add punctuation. Include spaces and exact case.</h2>'; ?> [/code The actual passwords are not shown in this code. It is a list of passwords in an array that is chosen based on the day and placed into the $clearTextPassword variable. This code worked without any problems when I had my files on the Pair.com servers. Recently I moved this code to my GoDaddy server. The code DOES generate a password and DOES create a new passwd file, but it appears the .htaccess file does not accept the password it has generated. So I went to a site online and manually created a password in order to test my .htaccess passwd combo. That worked fine. So it is my generated passwd file that seems to be the fault. My question is, does this PHP crypt function work differently on different servers? Is there a setting, or do I need to make some kind of changes in order for this to work on my GoDaddy server? I'm puzzled. Thanks.
×
×
  • 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.