View Full Version : AIM Sub-Profiler
walkingthepath
Fri 2nd Jan '04, 11:55pm
I have an AIM Sub-Profiler script that I've had problems with for about 2 years. It's a 5 PHP script package thing, and I think only one file has problems in it. The problem is, that the script is supposed to create a txt file called- 'last.txt' which logs the screennames which have access the accounts, so that the profile-holder can check who viewed his account. Problem is, the script never creates this file. This is one among many problems. If a PHP Scripter would be so kind as to contact me, I'd really really appreciate, and give you credit to your work, as deservered! :D THANK YOU very much! :p
BTW, the script I'm talking about is based on what you can get from the services of- http://www.subprofile.org/. It's an AIM subprofiler.
CeleronXT
Sat 3rd Jan '04, 10:59am
Er, if it's creating this file make sure the directory is CHMOD'ed with permission to do so (777?).
walkingthepath
Sat 3rd Jan '04, 2:37pm
Right, it's not making the folder CHMOD 777. It's not creating this file either, in the code. Basically, this script is very screwed up. Would you mind looking over the source and fixing it up in the places that it's deprived of correct functionality? THANK YOU :). I appreciate it :)
Er, if it's creating this file make sure the directory is CHMOD'ed with permission to do so (777?).
CeleronXT
Sat 3rd Jan '04, 5:10pm
Right, it's not making the folder CHMOD 777. It's not creating this file either, in the code. Basically, this script is very screwed up. Would you mind looking over the source and fixing it up in the places that it's deprived of correct functionality? THANK YOU :). I appreciate it :)I think in general it is person doing the installing that has to change the CHMOD to 777 on the necessary folder, and not the installer itself. Try manually CHMOD'ing the folder and see if that does it. If not, I can look at it. :)
Symen_4ab
Sat 3rd Jan '04, 5:52pm
Doesn't php returns an error ?
I actually did create a little script with file-writing functions in it, forgot to chmod the directory, and php returned me a "permission denied" error in the parsed output.
Maybe the server you are running the script on is set not to display php errors, if that's the case, you always can install a web server on your computer, to test things out.
easyphp (http://www.easyphp.org/) is an apache-php-sql package for windows, by the way ;)
You also could put some debugging instructions in your code.
Assuming you're using fputs to write something into the text-file, the code should look a little like this :
fputs("filename", "text") or die ("Error writing to file");
walkingthepath
Sat 3rd Jan '04, 6:18pm
No, not at all, you see, anyone is allowed to go and signup, on this script. Each user, gets his own directory created. Problem is, when someone signups, the script doesn't CHMOD that user's directory, and therefore doesn't create that TXT that I need. This is one among many other problems. Plus, if I could, I'd like to have this script work with MySQL because now it is only based on TXT files. Problem is, I'm not a PHP coder, nor do I know how to make the script talk to MySQL! :(. So, help would be really appreciated!!!! :) THX AGAIN!
Doesn't php returns an error ?
I actually did create a little script with file-writing functions in it, forgot to chmod the directory, and php returned me a "permission denied" error in the parsed output.
Maybe the server you are running the script on is set not to display php errors, if that's the case, you always can install a web server on your computer, to test things out.
easyphp (http://www.easyphp.org/) is an apache-php-sql package for windows, by the way ;)
You also could put some debugging instructions in your code.
Assuming you're using fputs to write something into the text-file, the code should look a little like this :
fputs("filename", "text") or die ("Error writing to file");
CeleronXT
Sat 3rd Jan '04, 6:46pm
Does the user that Apache/PHP/SQL is running under have permissions to change the CHMODing of a directory?
Errors from a script can be surpressed with @ in front of the function.
ie
@fputs('filename', 'text');
This won't produce any errors if the fputs() fails.
walkingthepath
Sat 3rd Jan '04, 6:49pm
Yes, I'm hosting this script on a webserver. Apache webserver WITH EVERYTHING. The script is just screwed up, I'm looking for someone to check out the script and fix some mistakes, if that's aight. I've been having this problem for a year now, and have already tried as many ways to fix it as possible. I figured out that it's a CODING problem....
Does the user that Apache/PHP/SQL is running under have permissions to change the CHMODing of a directory?
Errors from a script can be surpressed with @ in front of the function.
ie
@fputs('filename', 'text');
This won't produce any errors if the fputs() fails.
CeleronXT
Sat 3rd Jan '04, 6:57pm
I can take a look, although I have serious doubts I'd know what to do. I really don't like using hard files and thus I really haven't bothered to learn much of PHP's functions for interacting with the filesystem.
walkingthepath
Sun 4th Jan '04, 4:32pm
I've added your ScreenName and email to my AIM and MSN, accordingly, unfortunately, you haven't been online for me to show you this problem.... so, if you would.... ;)
walkingthepath
Mon 5th Jan '04, 11:16pm
?? Are you still there?? Can anyone else help me?
CeleronXT
Mon 5th Jan '04, 11:36pm
?? Are you still there?? Can anyone else help me?I don't really go on AIM/MSN much anymore. Is it something that can be posted here? There's nice syntax highlight here anyway..
walkingthepath
Tue 6th Jan '04, 1:01am
Well, sure, the script source is located on the following pages.
http://www.re-dream.com/profiles/view.phps
http://www.re-dream.com/profiles/new.phps
http://www.re-dream.com/profiles/profile.phps
http://www.re-dream.com/profiles/settings.phps
http://www.re-dream.com/profiles/view.phps
I don't really go on AIM/MSN much anymore. Is it something that can be posted here? There's nice syntax highlight here anyway..
CeleronXT
Wed 7th Jan '04, 12:37am
Hm, well...
In news.php, you might be able to do this (this is just from a very quick glance, mind you, it might be well off base)
Find:
fclose($pfile);
Add below:
$last_txt= @fopen("$dir/last.txt", 'w');
@fclose($last_txt);
walkingthepath
Wed 7th Jan '04, 1:04am
kk. THX! What else? LOL... anything else seem wrong in this script?
CeleronXT
Wed 7th Jan '04, 7:04pm
kk. THX! What else? LOL... anything else seem wrong in this script?Er, that didn't fix it? :(
DirectPixel
Wed 7th Jan '04, 7:57pm
If the file's not CHMOD'ed, then of course it's not going to be written to.
Take a look here: http://www.php.net/chmod
CeleronXT
Wed 7th Jan '04, 8:04pm
Well it has this...
mkdir($dir,0777);
walkingthepath
Wed 7th Jan '04, 10:11pm
lol, well, let's from the begin. Register a new user. I made user 'alpha' with the same password. As soon as I logged in, big errors!
Warning: main(/home/mastersf/public_html/profiles/users/alpha/config.php): failed to open stream: No such file or directory in /home/mastersf/public_html/profiles/mods.php on line 10
Warning: main(): Failed opening '/home/mastersf/public_html/profiles/users/alpha/config.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/mastersf/public_html/profiles/mods.php on line 10
Next, the preview box has the following errors-
Warning: main(/home/mastersf/public_html/profiles/users/alpha/config.php): failed to open stream: No such file or directory in /home/mastersf/public_html/profiles/view.php on line 54
Warning: main(): Failed opening '/home/mastersf/public_html/profiles/users/alpha/config.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/mastersf/public_html/profiles/view.php on line 54
and
Warning: main(/home/mastersf/public_html/profiles/users/alpha/count.txt): failed to open stream: No such file or directory in /home/mastersf/public_html/profiles/view.php on line 65
Warning: main(): Failed opening '/home/mastersf/public_html/profiles/users/alpha/count.txt' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/mastersf/public_html/profiles/view.php on line 65
times.
Create a user, and see for yourself. Unfortunately, after you press make changes, the errors go away. But it would be better if they didn't appear at all!! You know??
walkingthepath
Wed 7th Jan '04, 10:12pm
Ohh, and no. :(
Er, that didn't fix it? :(
walkingthepath
Sun 11th Jan '04, 11:32pm
what happened :(?
walkingthepath
Thu 15th Jan '04, 9:58am
No one else can help me? :(
equin0x
Sat 17th Jan '04, 11:08am
That "fail to open stream" error means that the file you are including isn't being found. In view.php when you say:
$dir = "$userpath/$sn";
// and then you say
include("$dir/config.php");
it is looking for the file config.php within the path "$userpath/$sn" but can't find it. Check the directory it is looking in (users/alpha) for the file. if the config file is somewhere else you have to change the variable $dir to match to config.php's loactions
if you have any other problems please contact me on my aim sn:
dark 3xplosion
i am also a php programmer for hire if you need any other php scripting for your site(s)
(btw: i can totally fix it, but i need to see where the files are, i need to see the contents of your public_html folder, /profiles, and the /users directories. if you dont mind showing me those i can fix your problem)
walkingthepath
Sat 17th Jan '04, 11:58am
Thank you! I will contact you! :). BTW, does it matter if I make your sn all lower case without a space? HEHE... I do not know if it make a dif.
Trigunflame
Sat 24th Jan '04, 3:37pm
the code is sloppy period, inefficient use of ereg/str_replace as well as excessive use of if conditionals, when a switch would take the place far better.
walkingthepath
Tue 3rd Feb '04, 7:37pm
Erm.... no one else can help me??
vBulletin® v3.8.0 Beta 3, Copyright ©2000-2008, Jelsoft Enterprises Ltd.