The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Perl - PostGreSql query garric UNIX and Linux Applications 0 06-01-2008 12:17 AM
Query in perl Dana Evans UNIX for Dummies Questions & Answers 2 11-21-2007 08:27 PM
perl query bishweshwar Shell Programming and Scripting 1 04-30-2007 06:03 AM
Incorrect SQL query in perl new2ss Shell Programming and Scripting 1 04-04-2006 12:26 AM
Query string assingment for other variable in PERL maheshsri Shell Programming and Scripting 0 01-30-2006 01:45 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 06-08-2006
Registered User
 

Join Date: May 2004
Location: UK
Posts: 74
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
Reply With Quote
Forum Sponsor
  #2  
Old 06-08-2006
Registered User
 

Join Date: Aug 2005
Location: Saskatchewan
Posts: 988
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?
Reply With Quote
  #3  
Old 06-08-2006
Registered User
 

Join Date: May 2004
Location: UK
Posts: 74
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
Reply With Quote
  #4  
Old 06-08-2006
Registered User
 

Join Date: Aug 2005
Location: Saskatchewan
Posts: 988
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.
Reply With Quote
  #5  
Old 06-08-2006
Moderator
 

Join Date: Sep 2002
Location: Hong Kong, China
Posts: 1,477
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!
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 11:51 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0