Solved

main frame variables passed to content frame

Posted on 2003-11-18
6
279 Views
Last Modified: 2008-03-06
ok, I have a strange one but I'de like to know if its possible. I have a frameset composed of two frames, a left and a right. left being navigation and right being content.  When I pass variables to the main frameset, how do I send the variables to the left frame without using one php file to build the frame?

url to frameset:

frameset.php?something=this

--------------------------------------------

frameset.php:

<frameset cols="170,100%*" frameborder="NO" border="0" framespacing="0" rows="*">
  <frame name="leftFrame" scrolling="NO" noresize src="left.php">
  <frame name="mainFrame" src="content.php" scrolling="AUTO">
</frameset>

-------------------------------------------
left.php:

????
0
Comment
Question by:dsyn
  • 3
  • 2
6 Comments
 
LVL 13

Expert Comment

by:lozloz
ID: 9775909
can you clarify what you mean, i don't quite understand? if you want a link to open in one of the frames without having to change the entire frameset, you just need to link with the target as the name of the frame.. e.g. <a href="left.php?variable=something target="leftFrame">Click here</a>

loz
0
 
LVL 1

Author Comment

by:dsyn
ID: 9775934
I'm linking to the main frame page like this:
<a href="frameset.php?something=this">link</a>

so the left frame needs to be able to parse it, but the frameset itself (in the code) doesn't have any variables in it.

does that help? maybe?
0
 
LVL 13

Accepted Solution

by:
lozloz earned 125 total points
ID: 9775996
so why not just have

<frameset cols="170,100%*" frameborder="NO" border="0" framespacing="0" rows="*">
  <frame name="leftFrame?something=<? print $_GET["something"]; ?>" scrolling="NO" noresize src="left.php">
  <frame name="mainFrame" src="content.php" scrolling="AUTO">
</frameset>

and then do more parsing in left.php
0
Easy Project Management (No User Manual Required)

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 1

Author Comment

by:dsyn
ID: 9776336
what is this? $_GET["something"];  

does that get variables directly from the address bar?
0
 
LVL 20

Expert Comment

by:Muhammad Wasif
ID: 9776521
yes, you can get the parameters passed in adress bar with $_GET
e.g

blahblah.com?something=some_text

echo $_GET["something"];

WASIF




0
 
LVL 1

Author Comment

by:dsyn
ID: 9776534
whoa, that's cool!

I'm gonna try that first thing tomorrow.. I'l let ya' know.. I'm still just starting out with php, so thanks for bearing with me.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now