need help with this little perl script

Discussion in 'Perl Misc' started by Danny, Feb 9, 2004.

  1. Danny

    Danny Guest

    this originally used the FLY executable to generate a graphical counter
    which used to be ok but my server disabled the executiuon of binaries, so
    now I just want the script to do what it does (update the counter.txt) and
    not do any FLY stuff. I just need something returned to the calling .html,
    I guess a blank graphic would do. But how do you do the below, so the html
    will call the counter script and have something returned.
    This part of the script doesnt work

    # $output = `$flyprog -i $fly_temp`;
    #$output = `blank.gif`';
    print "Content-type: image/gif\n\n";
    print "<img src=\"images\/blank.jpg\">";

    original code was:
    $output = `$flyprog -i $fly_temp`;
    print "Content-type: image/gif\n\n";
    print "$output";
     
    Danny, Feb 9, 2004
    #1
    1. Advertising

  2. Danny

    gnari Guest

    "Danny" <> wrote in message
    news:5NGVb.51406$...
    > this originally used the FLY executable to generate a graphical counter
    > which used to be ok but my server disabled the executiuon of binaries, so
    > now I just want the script to do what it does (update the counter.txt) and
    > not do any FLY stuff. I just need something returned to the calling

    ..html,
    > I guess a blank graphic would do. But how do you do the below, so the

    html
    > will call the counter script and have something returned.
    > This part of the script doesnt work
    >
    > # $output = `$flyprog -i $fly_temp`;
    > #$output = `blank.gif`';
    > print "Content-type: image/gif\n\n";
    > print "<img src=\"images\/blank.jpg\">";


    this is not a HTML newsgroup but i can tell you that images do not contain
    HTML tags

    >
    > original code was:
    > $output = `$flyprog -i $fly_temp`;


    just replace this line with some code that reads the blank
    graphic into $output. if any graphics libraries like Image::Magick
    are installed, you could generate your own image here.

    > print "Content-type: image/gif\n\n";
    > print "$output";
     
    gnari, Feb 9, 2004
    #2
    1. Advertising

  3. Danny wrote:
    > this originally used the FLY executable to generate a graphical
    > counter which used to be ok but my server disabled the executiuon
    > of binaries, so now I just want the script to do what it does
    > (update the counter.txt) and not do any FLY stuff. I just need
    > something returned to the calling .html, I guess a blank graphic
    > would do. But how do you do the below, so the html will call the
    > counter script and have something returned. This part of the script
    > doesnt work
    >
    > # $output = `$flyprog -i $fly_temp`;
    > #$output = `blank.gif`';
    > print "Content-type: image/gif\n\n";
    > print "<img src=\"images\/blank.jpg\">";
    >
    > original code was:
    > $output = `$flyprog -i $fly_temp`;
    > print "Content-type: image/gif\n\n";
    > print "$output";


    If what you want is running the script without displaying anything,
    you don't need to bother with a blank image, but you can just do:

    print "Status: 204 No Content\n\n";

    Or if you want to convert the script to a text based counter, you can do:

    print "Content-type: text/html\n\n";
    print $count;

    (or whatever the name of the variable is that contains the hits).

    HTH

    --
    Gunnar Hjalmarsson
    Email: http://www.gunnar.cc/cgi-bin/contact.pl
     
    Gunnar Hjalmarsson, Feb 9, 2004
    #3
  4. Danny

    Ben Morrow Guest

    "Danny" <> wrote:
    > now I just want the script to do what it does (update the
    > counter.txt)


    Have you read perldoc -q "increment the number" ?

    Ben

    --
    don't get my sympathy hanging out the 15th floor. you've changed the locks 3
    times, he still comes reeling though the door, and soon he'll get to you, teach
    you how to get to purest hell. you do it to yourself and that's what really
    hurts is you do it to yourself just you, you and noone else *
     
    Ben Morrow, Feb 9, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Wet Basement
    Replies:
    1
    Views:
    2,545
    BobMonk
    Jul 15, 2003
  2. dpackwood
    Replies:
    3
    Views:
    1,832
  3. ThaDoctor
    Replies:
    3
    Views:
    394
    Alan Woodland
    Sep 28, 2007
  4. nightsaber
    Replies:
    1
    Views:
    112
    Michael Stemper
    Jul 17, 2003
  5. Daniel
    Replies:
    1
    Views:
    221
    Bart van Ingen Schenau
    Jul 9, 2013
Loading...

Share This Page