Solved

selecting links and passing values (perl)

Posted on 2004-04-27
2
202 Views
Last Modified: 2013-12-25
using perl
my main page has a table with the numbers 1-52 (each one representing a week in 1 year)

selecting a number will determine what week i want to view data for.
(each number in the table is a link to the next page.....all numbers have  the same link as the next page process' the data)

i also have another directory that has 52 file, each file contains data for that certain week.

how do get it to select a week from my main page and it will pass the filename relating to that week to the next page.

currently my second page reads a file that contains data for the current week. i want it to be passed the week selected from the previous page so that it will read the file with the data relating to that week.

i have repeated myself here a few times...hope you undterstand what i am looking for!
0
Comment
Question by:plennon
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 

Author Comment

by:plennon
ID: 10929376
update:

here's want i want to happen

i want to select a link and when i select it a certain number will be written to a file. That number can then be read by any number of pages that needs it.

i need to know how to write to file after a link has been selected and before the linked page loads up

hope this helps
0
 
LVL 18

Accepted Solution

by:
kandura earned 50 total points
ID: 10943325
Writing that value to a file doesn't sound like a great idea. What would happen if two people visit this page, and each of them selects a different week?

Anyway, the general way to pass values between scripts is by using parameters, either in a form, or in a url.
A url such as
/cgi-bin/script.pl?var_a=value_a
would pass the parameter var_a to the script, with value value_a.

Your script would obtain this parameter by using the CGI module:

#!/usr/bin/perl
use strict;
use warnings;
use CGI;
$|++;

my $cgi = new CGI;
my $var_a = $cgi->param('var_a');
### $var_a now contains the value_a
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
This article will show, step by step, how to integrate R code into a R Sweave document
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question