Author Topic: [SOLVED] PHP in Iframe w/o src  (Read 2704 times)

0 Members and 1 Guest are viewing this topic.

Offline moTopic starter

  • Enthusiast
  • Posts: 139
    • View Profile
[SOLVED] PHP in Iframe w/o src
« on: May 28, 2009, 09:51:58 AM »
Is there a way to get php to render in an iFrame w/o specifying a src file? I just want to for example call a fucntion which prints a list and I want the list in the iFrame. I'm trying to avoid creating a paginated list by using an iFrame and I am new to iFrames.

Offline gevans

  • Addict
  • Posts: 2,649
  • Gender: Male
  • don't shoot the messanger
    • View Profile
    • Guernsey Web Design
Re: PHP in Iframe w/o src
« Reply #1 on: May 28, 2009, 09:54:51 AM »
I've been pushing this a lot recently, but with a lot of these ideas ajax really is a great option. With the constant improvements of javascript frameworks it couldn't be easier. Example jQuery could be just this simple,

$("#id-of-iframe").load("the-php-file-to-load");
I like starting my code with session_start();

Code: [Select]
ini_set('display_errors', 1);
ini_set('error_reporting', E_ALL);
Son of a biscuit eating bulldog
Use [code][/code] tags!!

Offline moTopic starter

  • Enthusiast
  • Posts: 139
    • View Profile
Re: PHP in Iframe w/o src
« Reply #2 on: May 28, 2009, 09:59:09 AM »
I've been pushing this a lot recently, but with a lot of these ideas ajax really is a great option. With the constant improvements of javascript frameworks it couldn't be easier. Example jQuery could be just this simple,

$("#id-of-iframe").load("the-php-file-to-load");

Thanks for the reply but I would still be referencing a php file to load. On my current PHP page I have a form where I can add entries to a database table. Below the form I have a list of all the entries in the table, I want just the entries in the iFrame not my entire page.

I could easily reference a new PHP file with the logic to produce the list but that would mean that for every page where I want to use the iFrame in this manner, I would have to create a seperate file with the actual list code for the iFrame to reference.

I really want to use the iFram like a wrapper or table tag. Is this possible?

Offline gevans

  • Addict
  • Posts: 2,649
  • Gender: Male
  • don't shoot the messanger
    • View Profile
    • Guernsey Web Design
Re: PHP in Iframe w/o src
« Reply #3 on: May 28, 2009, 10:04:36 AM »
Why not just using a scrolling div with overflow: auto; .

http://www.wickham43.supanet.com/tutorial/scrollingdivs.html

The above is a very basic (which is all you need) look at it.
I like starting my code with session_start();

Code: [Select]
ini_set('display_errors', 1);
ini_set('error_reporting', E_ALL);
Son of a biscuit eating bulldog
Use [code][/code] tags!!

Offline moTopic starter

  • Enthusiast
  • Posts: 139
    • View Profile
Re: PHP in Iframe w/o src
« Reply #4 on: May 28, 2009, 10:09:48 AM »
Why not just using a scrolling div with overflow: auto; .

http://www.wickham43.supanet.com/tutorial/scrollingdivs.html

The above is a very basic (which is all you need) look at it.

Son of a biscuit eating bulldog...This is just what I wanted.

Unfortunetely HTML, CSS, PHP, etc. are not my main languages as my focus is standalone/non-web applications and I am still learning what syntax, APIs, etc. are available to me.

Thanks.

Offline gevans

  • Addict
  • Posts: 2,649
  • Gender: Male
  • don't shoot the messanger
    • View Profile
    • Guernsey Web Design
Re: [SOLVED] PHP in Iframe w/o src
« Reply #5 on: May 28, 2009, 10:11:27 AM »
Son of a biscuit eating bulldog

HAHA, I had time for that quote
I like starting my code with session_start();

Code: [Select]
ini_set('display_errors', 1);
ini_set('error_reporting', E_ALL);
Son of a biscuit eating bulldog
Use [code][/code] tags!!