Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Provide a link to one page multiple frames 1

Status
Not open for further replies.

robrichardson

Programmer
Mar 14, 2001
86
GB
Hi there.

I need to be able to provide a link to customers which when they follow the link will take them to a webpage with three frames. These three frames are often never the same so somehow I need to put in the URL the names/links of each page to be loaded into the frames.

Do I need to set up a dummy page which has variables passed with it (eventually the link which is given to the customer) ie.


Then somewhere in this page run a script which sets the frames up with the passed variables ie.

function setFrames(Page1,Page2,Page3){
Request.getParameter("P1"); //not sure how to get the values from the URL

document.location.href=P1;
parent.leftFrame.document.location.href=P2;
parent.topFrame.document.location.href=P3;

I've tried all sorts of things but still no solution, any help?
 
Since you're using ASP pages... you can make your "DUMMY" page an ASP page, and pass in the params, then process the whole "selection" process server-side. Here's a sample with 3 frames (Header, Menu, and Content).

The link to this page would look like:

Code:
<%
option explicit
dim header, menu, content
header = (Request(&quot;h&quot;) & &quot;&quot;)
menu = (Request(&quot;m&quot;) & &quot;&quot;)
content = (Request(&quot;c&quot;) & &quot;&quot;)
if header = &quot;&quot; then
  header = &quot;defaultHeader&quot;
end if
if menu = &quot;&quot; then
  menu = &quot;defaultMenu&quot;
end if
if content = &quot;&quot; then
  content = &quot;defaultContent&quot;
end if
%>
<html>
<head>
</head>
<frameset rows=&quot;80,*&quot;>
  <frame id=&quot;header&quot; name=&quot;header&quot; src=&quot;/headers/<%=header%>.htm&quot;>
  <frameset cols=&quot;200,*&quot;>
    <frame id=&quot;menu&quot; name=&quot;menu&quot; src=&quot;/menus/<%=menu%>.htm&quot;>
    <frame id=&quot;content&quot; name=&quot;content&quot; src=&quot;/pages/<%=content%>.htm&quot;>
  </frameset>
</frameset>
<noframes>
<body><h3>My God, Man! Update your Browser!</h3></body>
</noframes>
</html>
something similar to that should work...
 
Thanks for both replies

I used the asp version so special thanks to Mr3Putt, worked a treat, exactly how I wanted it to work.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top