|
|
|
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Dynamic Framesets
Hi all,
I have what I think it probably quite an easy problem, but I am a complete newbie to php. I am looking to create a dynamic framset, where the varios pages of the frameet are defined by the requesting url. What I have done so far is this: The URL - http://..../frameset.php?menu=menu1&main=page1.html Then in the framseset: <frame src="$main"> <frame src="&menu"> This works fine, but it does mean I have to type in all thge exact urls to the pages, which leaves it open to spelling and typing mistakes. What I want to be able to do is something like: The URL - http://..../frameset.php?menu=1&main=3 Then in the head of the framseset doc, specify which page each number relates to: 1 = menu1.html 2= page1.html 3= page3.html and so on.... So I would be left with a list of all the pages in my site in the head of my framset and the numbers in the URL will decide which is displayed. I will also need to add something that will show the default page if nothing is secifed in the url or if an invalid number is entered. Can anyone help please? Many thanks! Mark mark@markdw.com |
|
#2
|
|||
|
|||
|
RE: Dynamic Framesets
here's what I'd do. Create a new page called, for example, "menudir.php." Contests as follows:
<?php $frame[1] = "menu.php"; $frame[2] = "home.php"; $frame[3] = "links.php"; $frame[4] = "contact.php"; etc etc etc ?> then in each page, simply put <?php include ('menudir.php'); ?> now your URL is as follows: http://yoursite.com/frameset.php?menu=1&main=2 and the contents is: <FRAMESET ROWS="10%, 90%" FRAMEBORDER=NO FRAMESPACING=0 MARGINWIDTH=0> <FRAME name="menu" SRC="<?=$frame[$menu];?>" FRAMEBORDER=NO FRAMESPACING=0 MARGINWIDTH=0 TARGET=MAIN NORESIZE> <FRAME name="main" SRC="<?=$frame[$main];?>" FRAMEBORDER=NO FRAMESPACING=0 MARGINWIDTH=0 NORESIZE> </FRAMESET> As you can see, it wil populate it for you. This is one of MANY ways to do it.... |
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Coding > Dynamic Framesets |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|