Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

href to a cgi script with file info

Status
Not open for further replies.

madaxe2

Technical User
Jan 23, 2005
43
US
Im trying to build a forum on my site

i can create a new thread now when i click on the title of the new thread i want it to start a cgi script that will show the history of the thread all the posts which im storing in a text file a new line for each post and information about who posted and when etc each field is split by a |

so my href line line points at the cgi and then i want to pass this text file to the cgi file

is this right and how do i extract the info once its in my script.

text file

Code:
my walruss had bad breath|20-march-2005|queen deva|england
does my penguin need a leash|21-april-2005|peter pa|france
Code:
<a href="lookatthread.cgi/../LOGS/FORUMPOSTS/$tlink">


MADAXE
 
Ive been thinking and im thinking that the url should be built like this

Code:
<a href="lookatthread.cgi?filename=$tlink">

but how do i extract the info in my cgi script

MADAXE
 
use CGI.pm to parse the data sent in a form or in the URI.

in lookatthrad.cgi:

Code:
#!usr/bin/perl
use strict;
use CGI qw/:standard/;
#other modules may follow

print header();

my $filename = param('filename');#gets the value of filename=$tlink

#rest of code

thats the basics. You can read the CGI.pm documents at cpan.org or perldoc.com or any number of other websites.
 
ok im confused i need an href to exec my cgi but i need the name of the href to tell the script which file to grab. How does CGI.pm help me and how do i replace my href to make all this work

MADAXE

REALLY CONFUSED.....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top