Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
calling CGI
Bhargav Coca
Hello Every One,
I am trying to call CGI script from my <img src=.......?task=$name> tag, All i have to do is capture this name in my CGI, i am using this code, please let me know, how can i capture the "name" passed to cgi?
use CGI;
use CGI;
my $q = CGI->new();
my $a = $q->param('name');
is my $a = $name??
Thank You
Find more posts tagged with
Comments
chuckles
I think you code should be like:
use CGI;
my $query = CGI->new();
my $task = $query->param('
task
');
You will also need to print some kind of response. Probably easiest to redirect to an image that is already on your site. Just use:
print $query->redirect("path/to/image"):
gzevin
a little note - you'd rather not use $a or $b in your code. They are used for sorting. You can repurpose them, but as far as I am concerned, it's not a good practice
Greg Zevin, Ph.D. Comp. Sc.
Independent Interwoven Consultant/Architect
Sydney, AU
Migrateduser
In general, single letter variable names are a bad practice other than obvious things like $i or $j for incrementers. As a purely stylistic matter, you should use a variable name that will be meaningful to anyone who might have to maintain your code in the future.
nipper
Unless, of course, your sole ambition in life is to maintain perl scripts you wrote long ago.