PHP Coding
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP RelatedPHP Coding

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old April 28th, 2002, 02:52 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 25
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

Reply With Quote
  #2  
Old April 28th, 2002, 09:55 PM
sethadam1 sethadam1 is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Orlando, FL
Posts: 223 sethadam1 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 3
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....

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Coding > Dynamic Framesets


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

Request Your Free Technology Downloads!
 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

Request Your Free Technology Downloads!
 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

Request Your Free Technology Downloads!
 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

Request Your Free Technology Downloads!
 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

Request Your Free Technology Downloads!
 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 




© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek