Results 1 to 8 of 8

Thread: Addition script

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Sep 2008
    Posts
    1,260

    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";

  2. #2
    PowerPoster kfcSmitty's Avatar
    Join Date
    May 2005
    Posts
    2,248

    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.

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Sep 2008
    Posts
    1,260

    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?

  4. #4
    Frenzied Member
    Join Date
    Apr 2009
    Location
    CA, USA
    Posts
    1,516

    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...

  5. #5
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: Addition script

    What do you want the code to achieve?
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

  6. #6
    PowerPoster
    Join Date
    Sep 2003
    Location
    Edmonton, AB, Canada
    Posts
    2,629

    Re: Addition script

    it's a counter.

  7. #7

    Thread Starter
    Frenzied Member
    Join Date
    Sep 2008
    Posts
    1,260

    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.

  8. #8
    PowerPoster
    Join Date
    Sep 2003
    Location
    Edmonton, AB, Canada
    Posts
    2,629

    Re: Addition script

    pm it to me if you'd like, I'll take a look later today.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width