Solved

CGI outputting FLASH POST variable

Posted on 2003-10-23
2
250 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
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

763 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

10 Experts available now in Live!

Get 1:1 Help Now