Something like frames in PHP? [Solved]

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
spec36
Forum Commoner
Posts: 28
Joined: Thu Nov 19, 2009 6:07 pm

Something like frames in PHP? [Solved]

Post by spec36 »

This is a newb question, but any help would be appreciated.

In HTML you can use frames and then target a specific link to load in a specified frame. Is there anything like this in PHP so I don't always have to load a new page? What is currently the best way to go about this(within PHP or not)?

Thanks,

Spec36
Last edited by spec36 on Thu Nov 19, 2009 7:11 pm, edited 1 time in total.
User avatar
iankent
Forum Contributor
Posts: 333
Joined: Mon Nov 16, 2009 4:23 pm
Location: Wales, United Kingdom

Re: Something like frames in PHP?

Post by iankent »

Well, two options:

1. You can continue to use HTML frames to split up your HTML pages. You can use A links to open specific php files in certain frames to do whatever you like. You can also use IFRAME's to embed one file in another. A quick and easy way, but doesn't look too good and has a few compatibility problems.

2. The more modern and 'cool' way of doing it - AJAX. This uses javascript to update the page without reloading the whole thing from the server. When the user clicks buttons etc the javascript code sends requests to PHP scripts on the server and updates the page with the result. This is the neatest way, but requires javascript and makes some of the programming a bit more complicated (although, also makes other bits easier!)

hth :)
spec36
Forum Commoner
Posts: 28
Joined: Thu Nov 19, 2009 6:07 pm

Re: Something like frames in PHP?

Post by spec36 »

thanks for the quick response. I will check out ajax.
Post Reply