Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

selecting links and passing values (perl)

Posted on 2004-04-27
2
Medium Priority
?
219 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 150 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

I hope you'll find this tutorial useful and interesting. So let's try to extend Tcl with a new package.  For anyone more deeply interested please check out the book "Practical Programming in Tcl and Tk". It's really one of the best written books abo…
The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

704 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