-
Addition script
Can someone please help me to get this piece of code to work... all i get is a 'Wait' displayed when i run it off a server
Code:
#!/usr/bin/perl
$lock_dir = 'Total';
$d = mkdir $lock_dir, 0777;
if ($d == 1 ){
open(FILE,"Total.txt");
$oldCount=<FILE>;
close(FILE);
open(FILE,">Total.txt");
$newCount=$oldCount+1;
print FILE "$newCount\n";
close(FILE);
rmdir $lock_dir;
} else {
$newCount = 'Wait';
}
print "Content-type: text/plain\n\n$newCount\n";
-
Re: Addition script
I don't know perl, but are you sure it is creating the directory properly?
Looks to me it is checking if the directory was created successfully, if not it will go to the else.
-
Re: Addition script
The strange thing is that it works on my own server XAMPP..but not on my webpagenotification.onlinewebshop.net server (this is a free hosted site)
Do you think the free site would have some sort of restrictions?
-
Re: Addition script
Be sure you've allowed write permission for your script - ie, the directory in which you're trying to create a directory, should have permissions set to 777. Your host may have a restriction, but they usually don't care if you create directories in your own web space...
-
Re: Addition script
What do you want the code to achieve?
-
Re: Addition script
-
Re: Addition script
Can i give one of you my ftp logon and password for my site to help me set it up... im pretty sure that i have everything correct... but it still wont work.
-
Re: Addition script
pm it to me if you'd like, I'll take a look later today.