CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Generating 2 different HTML pages from one script

 



Turco
Deleted

Feb 10, 2001, 12:15 PM

Post #1 of 5 (463 views)
Generating 2 different HTML pages from one script Can't Post

I have a form that is created by a cgi script, and I would like it so that when the user clicks the submit button, the SAME script generates a page based on the data contained wihtin the elements of the form, but I would also like it to display this new page not right under the form, but as a totally seperate page, as if the user clicked on a hyper link. So far, I have it so that it shows the generated page right under the fporm, but that is not what I want. Any help would be really appreciated.

Thanks in advance,

- Jeremy



kencl
User

Feb 10, 2001, 3:13 PM

Post #2 of 5 (461 views)
Re: Generating 2 different HTML pages from one script [In reply to] Can't Post

When you generate the page, instead of "printing" it back to the browser (IE STDOUT unless you've messed with it), print it to a file. Then just add a link to that file:

Code
$GeneratedPage = &GeneratePage; 
open(PAGEHANDLE, ">temp.html");
print PAGEHANDLE $GeneratedPage;
close(PAGEHANDLE);
print "<a href='temp.html'>Check out the new page!</a>";

sub GeneratePage {
my $page = # page generation script goes here
return $page;
}

>> If you can't control it, improve it, correlate it or disseminate it with PERL, it doesn't exist!


SirAnvil
Deleted

Feb 10, 2001, 3:33 PM

Post #3 of 5 (460 views)
Re: Generating 2 different HTML pages from one script [In reply to] Can't Post

I've been able to have my code create the page sort of like the prevoius post, then at the end of the code I use

print "Location: thenewpage.html\n\n";

then thenewpage.html is displayed as a totaly seperate page....

Hope it helps
from one newbie to another

SirAnvil
www.christiangamers.org


Turco
Deleted

Feb 11, 2001, 8:53 AM

Post #4 of 5 (452 views)
Re: Generating 2 different HTML pages from one script [In reply to] Can't Post

Thanks alot



muinatit
Deleted

Feb 11, 2001, 6:25 PM

Post #5 of 5 (430 views)
Re: Generating 2 different HTML pages from one script [In reply to] Can't Post

Pretty simple stuff guys. I'll attach one of my scripts that does that.

Jeffrey "muinatit" Lamoureux
muinatit@hotpop.com

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives