Solved

CGI outputting FLASH POST variable

Posted on 2003-10-23
2
262 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
[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
 
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

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

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

Preface This article introduces an authentication and authorization system for a website.  It is understood by the author and the project contributors that there is no such thing as a "one size fits all" system.  That being said, there is a certa…
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
The viewer will learn how to count occurrences of each item in an array.
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…

726 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