Two Pages in One??

They have: 4 posts

Joined: Feb 2002

Hi all,

Hope you can help with this strange problem - Basically I have
a CGI script calling a HTML form template - I want to put a page
of instructions before the user has to enter any details into the form
but because of the way the CGI has been writen this would mean
a sizeable re-write of the code (which I don't want to get into)

So is there anyway I can write a html page so that it contains 2 pages
but shows only one page at a time. I know I could use an anchor(?) command but would rather it didn't load both pages into one with a big gap in the middle - I would rather they displayed seperately of each other but still contained within the one html file.

I may have not explained the above very well so here's an example:

(1) I create a page called example.html
(2) the user see's the first screen that explains how you should
complete the form and says press 'continue' to go to the form.
(3) the user presses 'continue' and the form is then displayed
(4) All the above should be in 1 html file

Any ideas as to how this could be achieved with the widest possible browser support would be greatly appreciated! This is the last thing I need to do on a site and it's well holding me up trying different ways around it not to mention making me lose my sanity Wink

Any help, assistance, advice, large bottles of Vodka would be welcomed!

Thanks in advance for your time!

Cheers

Steve

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

I moved this to server-side scripting.

You would, if using CGI, have the content of the template be a variable. Same with PHP.

That's the theory, hopefully someone else can help you with the practice.

Smiling Suzanne

They have: 601 posts

Joined: Nov 2001

Hm. Sounds like a tricky one. The anchor trick is the easiest solution and would work perfectly.

What about javascript? And loading information into an IFRAME or a SPAN? This might not work on all browsers, however. And certainly no versions of Netscape prior to 6.

Have you tried changing the name of the intro page to the name of the page the CGI loads? And then load the form page from that one? That sounds to me like it could work.

If all else fails, post a link to your code and we'll see if we can help.

- wil

They have: 34 posts

Joined: Feb 2002

That's easy in asp.. save as example.asp

<?php
IF Len(Request.QueryString("page"))=0 THEN
?>

name:

<?php
ELSEIF Request.QueryString("page")="2" THEN
?>

################ Put the code you're using to process your form here##

<?php
END
IF
?>

They have: 4 posts

Joined: Feb 2002

Many thanks for the replies - much appreciated!
It looks like I might have to do this in cgi
as I don't like the look of using an anchor tag
- it just doesn't look right. So I will have to
look at rewriting some of the CGI so that it does
what I want.

Thanks for all the help though

Cheers

Steve

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.