Posting variables between frames

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
kalcee
Forum Newbie
Posts: 2
Joined: Wed May 14, 2008 3:11 pm

Posting variables between frames

Post by kalcee »

Hello ppl..

Excuse me if such a topic has been posted earlier. Here is my problem. I have 3 pages, one.php, two.php, three.php. I am taking a variable called keyword in one.php using a form. I have called the variable using $_GET['keyword'] in two.php page and wrote some sql queries based on that word.

As soon as I submit the one.php page, I need to send the keyword to a function search( ) in three.php also. But this three.php page is in a different frame where as one.php and two.php are in the same frame. So, Im having trouble passing the variable to this three.php page

I tried using sessions and I was unsuccessful at that. May be thats because I am new to all this PHP

Even if I were able to pass the variable, how could I just make the function search( ) to work as soon as I submit the variable ?

Any help would be deeply appreciated. Thanks in advance
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Posting variables between frames

Post by Christopher »

Sounds like you need to add Javascript to submit the values to the other frames. You may want to review why you are using frames in the first place. Javascript libraries like Prototype/jQuery allow you to do this stuff within a single page.
(#10850)
kalcee
Forum Newbie
Posts: 2
Joined: Wed May 14, 2008 3:11 pm

Re: Posting variables between frames

Post by kalcee »

I already added java script in two.php to re direct the page to three.php

this was the code

Code: Select all

<script language="javascript" type="text/javascript">
window.top.themap.Search();
</script>
"themap" being the name of that frame. It is accessing that function. But the function has some SQL query which makes use of the keyword which I am not able to access.
Post Reply