Experience webmasters please help or forward me, CGI type of linking

Gomce

Senior member
Dec 4, 2000
812
0
76
Hello,
My problem is that I want to use different type of linking.

Instead of linking to

eg. "A HREF=http://www.anandtech.com/" "/A"

I want to use this type of linking

eg. "A HREF=./cgibin/sitecode.cgi?anandtech" "/A"


How to do this? Cgi scripts or something? Databases? I work only in dreamweaver and don't have extra knowledge from MySql or Ms Access or similar programs, so if this can be achieved reading a readme.txt :) or following simple instructions or using a pre-made script tell me please or forward me to the site that has this specific info,

Many thanks

<> is replaced with "" in this post intentionaly
 

gopunk

Lifer
Jul 7, 2001
29,239
2
0
so basically... you want to link to a cgi script which then redirects the user based on the query string (the stuff after the question mark)?
 

Gomce

Senior member
Dec 4, 2000
812
0
76
anyone?
When it comes to something useful that everyone can benefit from no one replies, only when it comes to neffing :(
 

gopunk

Lifer
Jul 7, 2001
29,239
2
0
Originally posted by: Gomce
anyone?
When it comes to something useful that everyone can benefit from no one replies, only when it comes to neffing :(

well first off, you never answered my question...

secondly this is the wrong forum... you should have gone to the software/programming one.
 

yllus

Elite Member & Lifer
Aug 20, 2000
20,577
432
126
I've thought hard about coding a script of my own that basically this so I can track the number of hits I send to other websites from one I run myself. On my site, the links would have been something like:

<A HREF="http://www.test.com/redirect.cgi?forums.anandtech.com">AnandTech Forums</A>

In the example above, the script would internally record a hit being send to forums.anandtech.com and then redirect the user to the address contained after the question mark (forums.anandtech.com). If you wanted to strictly go by your example, where the only redirection data is the name of the site ("anandtech"), implementing depends more on the resources you have available, though there are basically still only two main options.

1) Write a CGI script in Perl which contains a simple two-dimensional array (or hash) specifying the name of the site ("anandtech" in your example) and the related URL to direct the user to. This array is hard-coded into the script.
2) Write a Perl script which interacts with a MySQL database. The script would take in the name of the site to redirect to (like "anandtech"), then query the database for a corresponding URL while at the same time recording any data on the user being sent that you'd like to keep.

Obviously option 2 has more flexibility, but also is not the easiest coding project in the world. If you work only in Dreamweaver, meaning only in base HTML/CSS, you're in some trouble. Someone possibly whip up a script a la option 1 in an hour's time, though. Good luck with that, but for the moment I'm going to play some UT2k3 and go to bed before class tomorrow. :p
 
Last edited: