TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 05-16-2008, 08:27 PM   #1 (permalink)
The Visitor
 
Join Date: May 2008
Location: good'ol unites States.
Posts: 3
Thanks: 0
JMHein is on a distinguished road
Default working with Iframes in php

I am very new to php and have no idea how to do what I would like to do, or even if I can.
I would like to have a web page were the menu and the main content are each in there own iframes, and when some one clicks a menu item it will ether refresh the main content with new data leaving the same menu, or refresh the menu with a new menu leaving the main content the same.
I am thinking that would require javascript but I don't know any more javascript then I do php yet.
So any idea on how I could do this or is it even possible to do this.
( I know that using php I could simply hard code a ton includes in with with a bunch of if statements that would load "Modules" so to speak. those modules would then act as the new html pages each one having a menu and a main content, but that would be way to complicated for what I want to mess with. and would simpler if I just stuck to normal static html pages.)

also any way to have a form in frame 1 that submits it's data to the page displayed in the same frame and have that frame refresh with the new data taken in to account?
example a chat page for a clan/guild. were the online game they all play is loaded in a gameframe, and the chat is loaded in a chat frame, each frame would have to act as 2 different tabs/windows.. were there would be different session IDs for each and cookies too. to loggin the chatframe would first load a loggin page and then would log the user in, and then refresh the chat frame with the main chat page. with out upsetting the other frame there by keeping the gameframe's SID and such in tact and letting some one login to the chat and the game at the same time with out one messing the other up with a page wide refresh, when the game resets the session on a page wide refresh.

if you read that whole thing thanks, and if you can help me, thanks again
JMHein is offline  
Reply With Quote
Old 05-16-2008, 09:23 PM   #2 (permalink)
Wizard
Top Contributor 
 
Village Idiot's Avatar
 
Join Date: Sep 2007
Posts: 1,299
Thanks: 17
Village Idiot is on a distinguished road
Default

I can hardly understand what you are saying, here is help for what I can read. Iframes are a HTML issue, they have nothing to do with PHP. And to send data from one Iframe to another requires javascript as far as I know.

You would probably be better to use ajax to update the content. With ajax you can update the content in a div dynamically. Iframes are messy and probably should be avoided unless you have to use them.

Also, if you want anyone to put any real time into helping you, you should put a little more time into making your posts in decent English.
__________________

Village Idiot is offline  
Reply With Quote
Old 05-16-2008, 11:00 PM   #3 (permalink)
The Visitor
 
Join Date: May 2008
Location: good'ol unites States.
Posts: 3
Thanks: 0
JMHein is on a distinguished road
Default

@Village Idiot
ok I have no idea why you can hardly read my English... it is just fine, maybe you have trouble reading it for some other reason? and to your last statement: "Also, if you want anyone to put any real time into helping you, you should put a little more time into making your posts in decent English."
I have been making spelling mistakes ever since 1st grade,a dn so I always look back over my posts a few times. if that is not enough time spent I don't know what is. I have seen other posts on here that get tons better answers than your answer with out even a clearly asked question, like I did.

any way I am not wanting help with that iframes themsleves, just wanting to know if I can refresh them using php.
I know that if I drop a meta refresh in an echo statement that will work for refreshing the frame that the meta refresh is located in. I have no idea how on earth you can possibly replace the iframe with a div in my example. each iframe in my example loads form 2 different domains. one is my domain, the other a online game's domain.
But I will look in to using ajax and divs when I am working with all the same domain. That might help me I on one of my web sites.

Last edited by JMHein : 05-16-2008 at 11:05 PM. Reason: spelling :P
JMHein is offline  
Reply With Quote
Old 05-17-2008, 03:40 PM   #4 (permalink)
The Visitor
 
Join Date: May 2008
Location: good'ol unites States.
Posts: 3
Thanks: 0
JMHein is on a distinguished road
Default

any way I think I have it worked out after spending 10 hours working on it....
I use a meta refresh in side of the same frame and use a form with a target for loading other frames.
and it seems to be working so far. each php page seems to be working as if it was opened in it own window even though it is in the same window And I am able to work with them as if they are part of the same page at the same time :)
just need to get some client side script in there and I should be able to do every thing else I want to do.
JMHein is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 01:23 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design