Solved

CGI outputting FLASH POST variable

Posted on 2003-10-23
2
255 Views
Last Modified: 2013-12-25
I have an issue with a CGI script (I think). What I'm trying to do is actually a workaround to something that will not work in Flash. I've come to the conclusion based on this site (and others) that a Perl CGI call is the best solution.

Basically, I'm sending one variable that contains the text to generate a web page. I want the CGI script to take this one variable and output it That's it. The code that creates the html text is in Flash. The meat of the content is created within a "for" loop and recursively added to this one variable.

I get the new page and I get the start and ending tags of the page, but I only get the last text item in the loop to appear. I did a "trace" on the variable in Flash and all the text is there, so I'm going on the assumption that my CGI script is wrong. It's a simple script (with an included library file) that I downloaded from another site and I honestly don't understand everything that's going on in it. I believe that the library file contains a script to parse the POSTed variable.

Can someone please post an example of how to read a posted variable and display it using a Perl CGI script?

Thanks!
0
Comment
Question by:jtlyonsden
2 Comments
 
LVL 8

Accepted Solution

by:
inq123 earned 250 total points
ID: 9609588
replace the "myvar" in "param('myvar')" below with the name of your variable.  If your variable's like <input type=text name=abc value=12345> then replace "myvar" with "abc" (I guess I don't need to explain in such detail but it doesn't hurt).  The code begins below:

#!/usr/bin/perl

use CGI qw/:standard/;

if (param())
{
 print header,
       start_html('display variable'),
       h1("Here is the variable:".param('myvar')."\n");
       hr;
}
0
 

Author Comment

by:jtlyonsden
ID: 9610372
Thanks for the help. I actually figured this one out in the meantime. I just altered the library script a little and it now works.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

I will show you how to create a ASP.NET Captcha control without using any HTTP HANDELRS or what so ever. you can easily plug it into your web pages. For Example a = 2 + 3 (where 2 and 3 are 2 random numbers) Session("Answer") = 5 then we…
JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
The viewer will learn how to count occurrences of each item in an array.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

816 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now