Hi, I just uploaded a simple membership site called FP Membership V 1.0 from http://www.awesomephp.com/index.php?Membership. I upladed and configured it as instructed and chaged all the permissions. The installer went ok and I can edit from admin and stuff but when I went to the log in page I am getting the following error messges <script> Warning: fopen() [function.fopen]: Filename cannot be empty in /home/scott/public_html/3test/login.php on line 94 Warning: fread(): supplied argument is not a valid stream resource in /home/scott/public_html/3test/login.php on line 95 Warning: fclose(): supplied argument is not a valid stream resource in /home/scott/public_html/3test/login.php on line 98 Fatal error: Call to undefined function encode_decode() in /home/scott/public_html/3test/login.php on line 105 </script> I have this for the code mentioned <script> <?php } else { $f = fopen($CF_QUESTIONFILE,'r'); while($t = fread($f,102465)){ $content .= $t; } fclose($f); $content = trim(preg_replace('/\/\*.*\*\//ism', '', $content)); $temp = explode("\n",$content); $random = rand(0,count($temp)-1); $rand = $temp[$random]; list($question,$registration_id) = explode('\n\\',$rand); $registration_id = bin2hex(encode_decode($registration_id,$CF_ENCDEC)); ?> </script> The first line being 92 Can someone help me out here?
Looks like $CF_QUESTIONFILE is empty. You might want to have a look throughout the script as to where that's initialised and make sure everything is ok.
You are not able to open the file. Other errors are related to this. Check what is inside this variable $CF_QUESTIONFILE by doing echo $CF_QUESTIONFILE;
Well now I feel stupid. I deleted the site and re uploaded it thinking I had a bad file upload or something. Hey it's happened before. During the upload I re read the instructions and found this. - If you are not implementing this script into your current application, then simply uncomment the : require_once('extensions/file.php'); Slolved that problem. Now I've made sure that all the correct chmod settings are correct and with a fresh upload I am getting the following errrors. Was wondering if it is a script problem or hosting problem since it is an htaccess file. For the registration I am getting this error code when I sign up. I do however get signed up but no redirect after sign up. Warning: file_put_contents() [function.file-put-contents]: Filename cannot be empty in /home/scott/public_html/3test/headers/htpasswd.php on line 112 When I go to the admin and try and delet a user I get this and the user is deleted though. Warning: array_keys() [function.array-keys]: The first argument should be an array in /home/scott/public_html/3test/headers/htpasswd.php on line 109 Warning: Invalid argument supplied for foreach() in /home/scott/public_html/3test/headers/htpasswd.php on line 109 Warning: file_put_contents() [function.file-put-contents]: Filename cannot be empty in /home/scott/public_html/3test/headers/htpasswd.php on line 112 This is what I have for the headers/htpasswd.php. First line is line 106 function save($file=false){ $fcontents = ""; if($file == false) $file = $this->_path; foreach(array_keys($this->users) as $user){ $fcontents .= $user.":".$this->users[$user]."\n"; } if(file_put_contents($file, $fcontents)){ $this->error = ''; return true; }else{ $this->error = 'Couln\'t save the file!'; return false; } }
In line 112, $file is empty. In line 109, users isn't an array. Methinks the code you're using is very poorly written. No error trapping? It should error out neatly, not with raw PHP errors. (And the error in 109 is just blatant bad code.)
Hey, thanks for the response. Was just about to repost. I figured the script might have a bug or two in it. Was hoping that it was something that is easily fixable. It is a very small open source script with just the basics. Link is on first post. This is the 4th script I have tried for this. I am trying to find the smallest membership script I can find to start with. I started out just using a membership log in script and starting from that. The one thing I need to do is easily edit the profiles. This script has that built in. Can someone tell me if the script is fixable or can someone suggest another script?
Membership in what? There are many CMS scripts that work (see Home - OpenSourceCMS ). Or you could use something like MyBB if you want a forum. What you use depends on what you want.