Perl CGI Query


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Perl CGI Query
# 1  
Old 06-08-2006
Perl CGI Query

Hi All,

This is quite a high level question so I appologise as if it sounds a bit woolly!

I'm running a script via apache's cgi-bin that calls another Perl script (from a browser):

Code:
http://192.168.000.000/cgi-bin/run_script.pl?SCRIPT=test.pl&text=RANDOM+TEXT&INPUT1=444444444444

This script parses some output (putting everything into a hash) from a UNIX command and populates a pre-formatted HTML template file - using the following command:

Code:
$html =~ s/%(\w+)%/$enabled_yn{$1}/g;

But there is more information returned by the original query - how do I enable my script so that it has a NEXT button so that I can get it to display the next HTML template file?

Or, could I pause the output of the original script so that it waits for user input from the browser before showing the next portion of information?

Am I asking too much from the Perl by itself should I be looking at some JavaScript (maybe AJAX'd) to do this?

Many thanks,

pondlife.
www.AddAnImage.com
# 2  
Old 06-08-2006
Quote:
Originally Posted by pondlife
Hi All,

This is quite a high level question so I appologise as if it sounds a bit woolly!

I'm running a script via apache's cgi-bin that calls another Perl script (from a browser):

Code:
http://192.168.000.000/cgi-bin/run_script.pl?SCRIPT=test.pl&text=RANDOM+TEXT&INPUT1=444444444444

This script parses some output (putting everything into a hash) from a UNIX command and populates a pre-formatted HTML template file - using the following command:

Code:
$html =~ s/%(\w+)%/$enabled_yn{$1}/g;

But there is more information returned by the original query - how do I enable my script so that it has a NEXT button so that I can get it to display the next HTML template file?
Why not make that part of the HTML template? If there's another page, replace it with the "next" link, otherwise, make it blank?
# 3  
Old 06-08-2006
HTML Template

Hi,

I can parse an output the whole of the information returned into one HTML file and print that but it's very long so it would be great to have the page(s) split - like with a NEXT prompt... But how would I split it?

What would the HTML link look like?
For added complexity the output comes between a header and footer that are called separately...

(sorry this is becoming an HTML question rather than a Perl one).

Thanks again,

pondlife.
www.AddAnImage.com
# 4  
Old 06-08-2006
Quote:
Originally Posted by pondlife
Hi,

I can parse an output the whole of the information returned into one HTML file and print that but it's very long so it would be great to have the page(s) split - like with a NEXT prompt... But how would I split it?
I see what you're getting at. Use a different template for each page, maybye in an array; the page number would determine which template gets used. The link would look like
Code:
<a href="http://192.168.000.000/cgi-bin/run_script.pl?SCRIPT=test.pl&page=2&text=RANDOM+TEXT&INPUT1=444444444444">next</a>

I don't know what that would look like in your templates.
# 5  
Old 06-08-2006
If my understanding of your question is right, It is possible for you to handle it with sessions, say CGI::Session. Data may be populated in the session once, and then those data may be displayed in chunks from a subsequent sequence of pages.

I hope I didn't misunderstand your question, but I really do not know the exact situation you are in. Also, having a script name directly embedded as a parameter in a URL is a severe security risk as it will open the possibility to execute any script right from a Web browser!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. OS X (Apple)

Perl CGI

I am trying to get my MacBook Pro with 10.8 Mt Lion set up to run Perl CGI scripts. Having a problem. I can start Apache Web Server with no problems. Why do I put the static and dynamic scripts? I which directory? I have looked at this article:... (3 Replies)
Discussion started by: djehresmann
3 Replies

2. Shell Programming and Scripting

CGI Perl : while loop in CGI perl

Hi Team, I am trying to connect to database(succeeded ) and print the records on the browser using while loop. But the elements of array are not displayed instead while loop is displayed directly. Instead of the below I can embed html statements in print but I am looking for the below style as I... (1 Reply)
Discussion started by: scriptscript
1 Replies

3. Shell Programming and Scripting

Perl CGI : unable to download the excel sheet from perl cgi page

Hi All, I have written an cgi perl script that displays an image(Excel image) and when clicked on that Image I need to download a excel sheet. I made sure that excel sheet exists in the folder with the given name but still I am not able to download the sheet. print "<center><table... (2 Replies)
Discussion started by: scriptscript
2 Replies

4. Shell Programming and Scripting

Perl cgi pages out of cgi-bin folder in WINDOWS

Hi team, I have a typical problem with cgi pages in apache webserver in WINDOWS I am able to execute(display) the pages that are saved in cgi-bin folder. But I am not able to execute the pages stored in htdocs or other folder other than cgi-bin folder. Could anyone please let me know how... (1 Reply)
Discussion started by: scriptscript
1 Replies

5. Shell Programming and Scripting

CGI in Perl

Hi, Am unfamiliar with using CGI modules in Perl. Though i checked in few sites about CGI , i dint get a clear idea. Can anyone please explain me the purpose of these statements, it ll be very helpful to me #!/usr/bin/perl use CGI qw/:standard/; use Storable; use Data::Dumper; my... (1 Reply)
Discussion started by: irudayaraj
1 Replies

6. Web Development

problem with exporting vairable from one perl cgi to another perl cgi script while redirecting.

Can anyone tell me how to export a variable from one perl CGI script to another perl cgi script when using a redirect. Upon running the login.pl the user is prompted to enter user name and password. Upon entering the correct credentials (admin/admin) the user is redirected to welcome page. My... (3 Replies)
Discussion started by: Arun_Linux
3 Replies

7. Shell Programming and Scripting

Perl CGI forms

Hello All, I am calling a script 'abc.pl' in my action section while creating a form. This will automatically pass parameters that are collected in the form. But I want to pass other parameters which are actually just variables in the script I am calling 'abc.pl' from. How do I make sure these... (4 Replies)
Discussion started by: garric
4 Replies

8. UNIX for Dummies Questions & Answers

Parsing query string from cgi

Im having trouble getting the string I get from a cgi form to only be the value entered. I need to use that value as an argument but cant use it in the way it is returned. I get "bustype = restaurant" but I want just "restaurant" because i am going to be using that value as an argument in a csh... (3 Replies)
Discussion started by: am2005
3 Replies

9. Shell Programming and Scripting

checkbox_group => CGI, Perl

Hi, In my cgi script(written in Perl using cgi.pm) i have a checkbox and i want all the items to be checked. Here is what i use: checkbox_group(-name=>'studenten_in_groep', -values=>\@member_keys, -defaults=>\@member_keys, -labels=>\%temp_members, -columns=>2), But no boxes are checked...... (18 Replies)
Discussion started by: tine
18 Replies

10. Shell Programming and Scripting

Perl CGI.pm

my box is FreeBSD4.3 and I use Perl 5.0005_03. Here is the CGI script. test.cgi ...... if ($query->action eq 'detail') { ...... print $query->hidden('action', 'modify'); ...... } I found that the result of test.cgi?action=detail is not what I expected. the script does not... (4 Replies)
Discussion started by: tonyt
4 Replies
Login or Register to Ask a Question