View Single Post
  #12  
Old 08-17-2001, 09:32 AM
creamy
Guest
 
Posts: n/a
Default

um, i can't fix the last part on my own... maybe someone who knows php can help

when you tell it to mail you a password, its supposed to generate one from a list of words and mail that one and store it in the database. it's getting stuck on the easy part - opening the list of words.
the instructions say:
Quote:
Save the files "ppassgen.php", "encrypt_all_passwords.php", and "words.txt" to your VB "admin" directory.

You can use any word list to generate your random passwords, I used my system's /usr/dict/words. Just be sure to save your wordlist to "words.txt" in your "admin" directory.
well i did that, and i checked the chmod incase it matters, but even at 777 it doesn't work. i get this error instead:

Code:
Warning: fopen("words.txt","r") - No such file or directory in /home/mod-chi/public_html/admin/ppassgen.php on line 29

Warning: Supplied argument is not a valid File-Handle resource in /home/mod-chi/public_html/admin/ppassgen.php on line 37

Warning: Supplied argument is not a valid File-Handle resource in /home/mod-chi/public_html/admin/ppassgen.php on line 38

Warning: Supplied argument is not a valid File-Handle resource in /home/mod-chi/public_html/admin/ppassgen.php on line 37

Warning: Supplied argument is not a valid File-Handle resource in /home/mod-chi/public_html/admin/ppassgen.php on line 38
(repeating forever)
the code in the first part of ppassgen.php is:

Code:
<?
/* 
 * function ppassgen() 
 * parameters: 
 * $words = the name of the file w/ the words (one per line) 
 *      or and array of words 
 * $min = the minimum number of words per password 
 * $max = the maximum number of words per password 
 * $cutoff = the minimum number of characters per word 
 * $sep = separator for the words in the password 
 */ 

function ppassgen($words= "words.txt", $min=2, $max=4, $cutoff=5, $sep= "_") { 

	
		// This is here for cases when we email a password from the admin control panel


    if(is_array($words)) { 
        /* if we have passed and array of words, use it */ 
        $word_arr =  "words"; 
         /* 
        while(list($k,$v) = each(${$word_arr})) { 
            echo "$k $v<BR>"; 
        } 
        */ 
    } else { 
        /* read the external file into an array */ 
        $fp = fopen($words, "r");      <---------------------------- LINE 29

        if (!fp) { 
            echo  "[ERROR}: Could not open file $words<BR>\n"; 
            exit; 
        } else { 
            /* assuming words of up to 127 characters */ 
            $word_arr =  "ext_arr"; 
            while(!feof($fp)) {             <---------------------------- LINE 37
                $tword = trim(fgets($fp,128)); <------------------- LINE 38


                /* check for minimum length and for exclusion of numbers */ 
                if ((strlen($tword) >= $cut_off) && !ereg( "[0-9]",$tword)) { 
                    $ext_arr[] = strtolower($tword); 
                } 
            } 
            fclose($fp); 
        } 
    }

i already tried the following:
not putting quotes around the filename
putting a full path to the words.txt
putting a relative path to words.txt

with no success....
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01959 seconds
  • Memory Usage 1,775KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete