Gossamer Forum
Home : Products : Links 2.0 : Installation -- Unix :

Need help to modify a cgi

Quote Reply
Need help to modify a cgi
Hi,

I have made a copy of rate.cgi and called it visit.cgi, and I plan to use for links to my search engine ie. Visit sinssek.com and the link look like http://www.sinseek.com/lcg-bin/visit.cgi?ID=211&rate=10

This is to increase the site owners ranking when sending hits back.

What I want to do is modify the script so it doesn't call the "&site_html_rate_success" routine in rate.cgi, instead it should send the user to my home page if the rating is successful.

Anyone who knows how to modify the cgifile?

Or maybe someone else have found a better idea for doing what I want.

Hoping for help.

Best regards,
Peter
Quote Reply
Re: Need help to modify a cgi In reply to
At the bottom of rate.cgi, find the following:

Code:
open (HIT, ">$db_rates_path/$id") or &cgierr ("Can't increment counter file '$db_rates_path/$id'. Reason: $!");
print HIT "1 $rating\n$time\n$ENV{'REMOTE_ADDR'}";
close HIT;
&site_html_rate_success;

Change the last line to point to your home page. The easiest way to do this is to change it to:

Code:
print "Location: $build_root_url/$build_index/\n\n";

I hope this helps.
Quote Reply
Re: Need help to modify a cgi In reply to
Hi,

got the job done, just removed an "/" as it pointed to /index.html/

Now I just want to find a way to skip the date check for ratings using visit.cgi.

Thanks,
Hairy Pete
Quote Reply
Re: Need help to modify a cgi In reply to
  
Quote:
got the job done, just removed an "/" as it pointed to /index.html/

Oops! Sorry 'bout that.

I am not exactly sure about the date check thing ... why do you want to skip it?

Are you aware that there is already a published mod for an external Rate It feature? It, and other mods, can be found at www.gossamer-threads.com/scripts/resources/Links/Modifications/Version_2.x/

[This message has been edited by Bobsie (edited March 23, 1999).]