• Howdy! Welcome to our community of more than 130.000 members devoted to web hosting. This is a great place to get special offers from web hosts and post your own requests or ads. To start posting sign up here. Cheers! /Peo, FreeWebSpace.net
managed wordpress hosting

Need PHP/CGI help... or simply entropy banner help

D

New Member
Hello!

I'm currently hosted at HostRocket. They have a very useful script pre-installed on all accounts - Entropy Banner. I'm having a tiny, but big problem when entering URL's to link the images to.

It's a CGI script for those who don't know. I have the clickcount.pl script to track how many people are clicking on links. The code works like this:

Code:
[url]http://www.mydomain.com/cgi-bin/clickcount.pl?url=http://www.freewebspace.com/[/url]

It works perfectly when I enter it on text and image links I create, but whenever I go to entropy banner and enter the URL like that, it confirms it, but when I view it on the site, this is how it appears:

Code:
[url]http://www.mydomain.com/cgi-bin/clickcount.pl?url[/url]

The URL gets cut off after the "url" tag. I tried getting help from their support, they gave me a couple of things to try, like put \"url"\ before the domain, it didn't work. The URL got cut off again, but this time it ended at "url\", instead of "url".

So when I told it that didn't work, they told me to ask at PHP message boards, and I've gotten the most help from here, so please help! BTW, my pages are in PHP, so if there is a better PHP script that can do this and the URL won't get cut off, please direct my attention to it. Thanks!!
 
I think I know exactly what's causing this. It plagues a lot of Perl scripts out there.

When parsing the query string, the script is splitting on the '&' character first, then splits on '='. Unfortunately, they almost always seem to lose anything after a second = sign.

Try entering the URL like this:

.../clickcount.pl?url%3Dhttp...

(truncated so the board doesn't link/truncate it)

In other words, replace the = with a %3D. I can't guarantee this will work, it really depends on whether it decodes %-encoding before or after splitting the query, but it's certainly worth a shot...

If that doesn't work, and you can actually edit the script (and are permitted to do so per it's copyright etc), find where it does something like this:

...
($name, $value) = split (/=/,$query);
...

And instead try (not tested but should work):
...
($name,$value)=$query=~/^(.+?)=(.*)$/;
...

If you're familiar with Perl you'll understand this. If not, it's probably best to enlist a guru-friend for assistance...
 
Back
Top