Add to Google

<? Include ?> <iframe/> - This could save me tons of time!

Pages: 1, 2, 3
free web hosting

Read Latest Entries..: (Post #23) by Amezis on Jul 24 2005, 07:59 AM. (Line Breaks Removed)
What I want, is just to get <?php include($load); ?> to work, since I think it's more usefull than <?php include 'file.htm'; ?>, and there will be less files, but for some reasons I can't get it to work!
Read the FIRST post of this Topic. - Express your Opinion! Contribute Knowledge :-).

Open Discussion > CONTRIBUTE > Computers > Programming Languages > PHP Programming

<? Include ?> <iframe/> - This could save me tons of time!

Joshthegreat
Does anyone know if it is possible to target links into an area using the include tag? Because I don't want to use an iframe.
So I only need one page and all the links would appear where the php include tag is.
This would be super helpfull if anyone could explain if it was possible, and if so how to do it, or if not possible, any alternate codes that would to the same job, excluding the iframe and the regular frame. Thanks.

Reply

no9t9
the include FUNCTION is not an HTML tag and cannot be changed once it is downloaded by the browser. This is because the include function is a SERVER SIDE script meaning it is run by the server and replaced with whatever file you put in the include function. That include function is replaced and the browser (user) never sees the code.

The only way to change the file included in the function is to load another page. You can do this with URL variables.

example: http://yoursite.com/index.php?load=page1.html
http://yoursite/index.php?load=page2.html

in your index.php file you have the code: <?php include($load); "> This will load whatever page you put after the load= in your url. So when you create a link, just use the above url and it will update.

Reply

Joshthegreat
I don't understand at all... maybe what I have at the moment is fine. I just have to change part of the table for all my content pages. No worry though. Thanks for your help.

Reply

beeseven
I'm not sure I entirely understand what you're saying, but what if you made a table or something similar then included the stuff in there?

CODE

<table>
 <tr>
  <td>
   something
  </td>
  <td>
   <?php include 'file.ext'; ?>
  </td>
etc...

Reply

Joshthegreat
I know how to do that. All I'm asking is...
Is it possible to use the include code like an iframe, meaning that you can target files to appear in the place of the include code instead of just one stuck file there. If you know what I mean...

Reply

nancmu
If my understand is right, I suggest you using javascript smile.gif .
The same as "toggle menu"
--> onClick="this.style.display=none" -- for hide your page instantly.
--> onClick="this.style.display='' " -- show your page.

or use function

function toggle_page(page) {
if (page == 1) {
p1.style.display="";
p2.style.display="none";
}
else {
p1.style.display="none";
p2.style.display="";
}
}

<a href=# onClick="toggle_page(1)">show page1</a> | <a href=# onClick="toggle_page(2)">show page2</a>

<div id=p1>
<? include("page1.php");?>
</div>

<div id=p2 style="display: none">
<? include("page2.php");?>
</div>

// something like that.
// and hope, will be right in your mind rolleyes.gif .

 

 

 


Reply

Saint_Michael
i don;t don't know how the coding might go but why dont you use the <div> tags to seperate everything and then create navagation menu from thier that would make sense.

Reply

Joshthegreat
Thanks nancmu, but I just had an idea. Well, not so much of an idea, but a quesiton at least.

is what no9t9 said basically the equvilant (below)? And if it is could someone please tell me how all of that works? Thanks.
http://yoursite.com/index.php?load=page1.html.

Basically what I want is the effect of an iframe, but without using one.

Reply

no9t9
the way i understood your request was that you are trying to use one page something like a template and load the content into an iframe. Except that you don't want to use iframes but instead you want to use the php include function.

so, what I told you to do is exactly that.

basically if you use URLs with variables like this
http://yoursite.com/index.php?load=contentpage.html
you can get the same effect.

in your index.php file you create the template for your site. basically everything that doesn't change on your site, like navigation, backgorund, etc. then you create your content (the stuff that would go in an iframe) in a file called contentpage.html (or whatever you want).

the structure of the index.php file will look something like this.

<banner HTML Code>
<Navigation HTML Code>
<?php include($load); ?>
<footer HTML Code>

now when you want to change the content, you simply change the $load variable.
http://yoursite.com/index.php?load=anothercontentpage.html
so for example if in your navigation you want to link to a CONTACT page, you would use :
<a href="http://yoursite.com/index.php?load=contact.html">Contact</a>

this will not change any of your banner, navigation, footer HTML but will update the CONTENT area with your contact page.

BTW, using javascript for loading page content is not a good idea because some people disable javascript and if they do, your page will be completely useless.
PHP is the way to go.

Reply

Joshthegreat
THANKYOU THANKYOU THANKYOU!!!! Your getting a juicy reputation point for this! Thanks a load man. You need a medal, thanks a bunch, I didn;t really understand what you said before, but I do now. Thanks loads man.

Reply

Latest Entries

Amezis
What I want, is just to get <?php include($load); ?> to work, since I think it's more usefull than <?php include 'file.htm'; ?>, and there will be less files, but for some reasons I can't get it to work!

Reply

hype
Or you can trying integrating all the codes into the files you want to open then lesser error will open... Using the includ codes is very dangerous and may result to pages breakdown...

Reply

karlo
I suggest you try using XMLHttpRequest to make your website unique, as well as making your website load faster, and consumes less bandwidth. The include function in PHP is really useful, but when I comes to uploading your whole website, having seperate files can be a little pain, so if you can, use only 1 PHP file for all of your pages. Or use MySQL to fetch each pages. biggrin.gif

Reply

Amezis
Still can't get it to work. I am using <?php include 'file.htm'; ?> and it works fine, but <?php include($load); ?> won't work, when I enter loadpage.php?load=testpage.htm (that's what I called it). Do it really have to be INDEX.php or is LOADPAGE.php allowed too? Where the testpage.htm should load, there's nothing...

Reply

no9t9
QUOTE
Well, easy, easy code, but I know I have forgot something. what?
In the same folder, I have "contentpage.html". Trying to load index.php?load=contentpage.html don't work.
Hehe as I said, I don't know anything about php, just trying it now tongue.gif
*



the code looks right to me. what is your website and what is the problem? any error messages? is your file named index.php? are there other index files in the same directory? delete index.htm or index.html because they will get loaded before index.php (or you can rename them). Post your site so it will be easier to diagnose the problem.

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.

Pages: 1, 2, 3
Recent Queries:-
  1. php include iframe http:// - 27.08 hr back. (1)
  2. php include met iframe - 28.87 hr back. (1)
  3. include iframe - 49.46 hr back. (1)
  4. php includes with iframes tables - 57.27 hr back. (1)
  5. including iframes - 62.27 hr back. (1)
  6. get html code of iframe - 62.67 hr back. (2)
  7. iframe include - 36.29 hr back. (2)
  8. using php includes vs iframe - 65.34 hr back. (1)
  9. include a iframe - 82.63 hr back. (1)
  10. php http include iframe - 124.89 hr back. (1)
  11. include php file in iframe - 126.06 hr back. (1)
  12. php include iframes - 82.14 hr back. (2)
  13. php include iframe - 80.69 hr back. (2)
  14. yahoomail sign - 151.53 hr back. (1)
Similar Topics

Keywords : save, tons, time

  1. Google Going Back In Time
    (5)
  2. Windows Xp Sp2 Restarting After Some Time
    (6)
    Hi , I dont know what happened but My system restarts after a few Minutes (at max an hour). Can
    someone guess what might be wrong. It displays a System Shutdown Timer (initiated by
    Administrator) and then restarts after 60 sec. This is an SP2 so I dont think its a blaster. I
    have a ZoneAlarm Security Suite and it didn't detect anything. I even Scanned my Windows folder
    from Kaspersky using my Second OS (Vista) but that also didn't detect anything . .. Any guesses
    ??....
  3. Time Travel - An Impossibility?
    Is time travel possible? Will we ever manage it? What are the dangers? (14)
    Ok, I dont really know anything about the subject. But I just spend a lot of time thinking about
    this kind of thing, so thought i would post my thoughts and ideas, and see what people think. First
    of all; What do people mean by "time travel" Now, i think most people think of traveling back or
    forward in time, and being in a certain place at a certain time, in full body, when they think of
    time travel. But is that possible? But surely time travel could just be seing, history, or future.
    And how would it work? Surely it would involve opening time, and placing yourself, i....
  4. Firefox Hates Moveplayer
    Help me save my crashing browser. (5)
    I have a serious problem on my main PC. Firefox refuses to open. It goes directly to the crash
    report, listing the add-ons that failed on startup. I managed to launch it from the Run window into
    Safe Mode, and again it crashed immediately, but this time only listed one add-on: MovePlayer. The
    uninstall instructions I found require a Firefox capable of loading. I'm running Windows XP and
    have no listing for Move in my Add/Remove Programs dialog. What's my next step?....
  5. Spare Time?
    (5)
    What do you guys do in your spare time, when you are not on the computer or at school/work? For me,
    well, I play sports, like hockey, baseball, and football. I also play 6-7 musical instruments, with
    drums being my favorite. I also plan on learning the bass guitar in the next few years, after I get
    pretty good at the drums, which I am focusing on now. How about you guys?....
  6. The Time Traveller's Wife
    Recommendation (1)
    Audrey Niffenegger is the author of this absolutely brilliant book! Her writting is very
    'real' and the story line is definitely one you have never read before. The Time
    Traveller's Wife is an absolute must for anyone who enjoys reading. The main plot is about a
    guy, Henry, who time travels and basically meets his wife when she is 10 and he is about 40 years
    old! I will not tell you any more so as not to reveal more of the story..... 'HERE'S
    THE NEXT THE LOVELY BONES...A RARE BOOK' -EVENING STANDARD 'At its core The Time
    Traveler'....
  7. Is It Possible To Save Money If You Have Kids?
    Credit Tax (15)
    Is It Possible to Save Money If You Have Kids? ....
  8. Creating A Shortcut List Near The System Tray
    Time saver tip for windows (4)
    Are you bored at work today? Here's a small enhancement to your desktop. Hope you like it. I)
    When you have to open any program you have to click "Start" "All Programs" and then choose your
    selection from the programs folder. Now how would it be to achieve the same task in just two clicks?
    You can save all your favourite program shortcuts in a folder and view that through a tiny arrow
    near the system tray. Its very simple. You would tell, "Ya, I almost knew that". Here's how to
    do it. a) First create your folder and add the shortcuts you want to access. The f....
  9. Time Keeps Slipping By
    a song i wrote (0)
    I look out of the window just to see time pass me by always in the shadows cought in my own lies
    Death, he stands before me as i face him on my own Chorus And the world is gone time
    keeps slipping by Then all is known but life keeps going on Looking in the sky clouds keep going
    by all i have to know is that time keeps slipping by Feeling only sorrow I know what is
    comming next Death tells me to follow I slowly see my fate Thinking of all i've lost as i
    walk into the shadows I can't turn back now I know that i am lost Repe....
  10. Why Is The Shoutbox Time Wrong?
    (10)
    Hi guys, this is bugging me now! Whenever i post in the shoutbox at first it displays the
    right time, presumably while it saves to the DB and refreshes as the smilies dont come up straight
    away either, then it seems to add about 30 minutes to the time! I have my forum time settings
    set correctly and obviously it goes into the shoutbox script correctly but the script or DB must
    somehowe alter it to make it half hour or so later? Any ideas? EDIT: It adds exactly 39 minutes to
    my time stamp for some reason....
  11. Achieve Planner
    30 Trail Time & Project Management Tool (0)
    Hey all: If you are sick of the calender in Outlook and looking for a good time management/project
    management tool Achieve Planner is pretty cool and you get a 30 day trial to test its functions.
    http://www.effexis.com/achieve/planner.htm I have no financial interest just thinks it'a a
    good app. One feature is being able to properly prioritise tasks and you can color code them.
    Thats all. KJ ....
  12. Easy Realmedia Producer
    Convert AVI to RMVB to save disk space (0)
    I tried this nice tool to convert some movies to rmvb format and they work great. You can find the
    software here: http://www.freewarefiles.com/ Not sure if it supports direct rip of DVD's but
    it definitely supports a lot of video format. It can also convert some non-Nokia 770 playable rmvb
    files to playable ones. Anyways, enjoy.....
  13. Are Airlines Gonna Save The Planet?
    (11)
    Oil price is on the rise... so why not going a bit lighter and "drop off" a few things when we fly?
    certainly a few billions (?) are spent every year to lift up all those ice cubes people enjoy while
    flying around... so why not cut them to a minimum or cut them at all? This is one of the latest
    news I've heard about airlines cutting on their 'fringe' services, after starting to
    charge for soft drinks, water etc. over the past few years... now I don't think cutting on water
    is such a nice behavior, as passengers are deprived the right to take their own wa....
  14. Another Cust. Service Rant... This Time As A Customer
    (6)
    On monday I experienced something that I haven't in a long time. Good customer service. I work
    in the line of customer service, and I have come to the conclusion, there are different levels you
    can provide. True customer service is hardly ever given anymore. For example, I ordered from
    McDonalds recently and I ordered a McFlurry and a Sundae. I was given a McFlurry and a Shake. It was
    at the start of a minor busy period (3 or 4 people were behind me waiting to order), so I waited
    until the others were served, and I said to the lady that served me in a polite tone, "I....
  15. Debate With The Religions : Christian Vs Islam Vs More
    This time I don't debate, you do (17)
    So I've done some nice debating and it's been nice. I've had multipe 5+ People ganging
    up on me thinking it will make a real difference, but after pages and pages of debating, it
    didn't go anywhere. Simply because they are afraid to look at it from the other angle, the other
    side, because they fear going to hell. It's their problem. So I made this creative topic. This
    thread is not ment for argueing and fighting. I want to see how you guys feel about each other's
    religion" So muslims, christians, and anything else in between, you have your own....
  16. New Sig Girl Here :)
    First Time on these Forums (7)
    Hey everyone I'm a BASIC siggy maker from Down Under (good ol' Aussie) Looking to become a
    regular on the forums if you like my work hehe. Been making sigs on and off in PS CS3 for about a
    year now, I'm not the best but I know a few bits and pieces /smile.gif"
    style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /> Here's 2 I did this week,
    the first one was for a friend who ended up not wanting it lol, and the second one is mine. 3rd one
    is an older sig of mine from when I was playing the Hellgate London Beta. This is also
    just ....
  17. Budding Java Game Developers?
    Ever wanted to make your own java web-based game, but not had the time (10)
    Right, this is the first post of hopefully many in this thread. Basically the idea is to get many
    developers together to share ideas and knowledge to create our very own game. First we'll be
    asking for is any ideas of what kind of game everybody would like to make, and then we'll set
    about assigning tasks depending on everybodies skills. We will need programmers, artists,
    web-designers, even admin and marketing. This will be freeware, but the experience will be great.
    So, ideas anyone?....
  18. Firefox 3 Sucks - Time For Another Browser
    (66)
    No seriously, I've been using Firefox since 0.x releases. I loved it. Every release, despite
    having no huge features, was a great update. Version 3, however, totally messes everything up. Its
    default interface is ugly. And no Home button, really ??? (ps. I kno i can drag it back from the
    bookmarks toolbar but still, its stupid). The address bar search thing. I liked the concept, but I
    am so used to the old way, this actually distracts me, I don't want to search my history
    everytime I type a new address. Plus the slide out is huge now making the whole thing feel t....
  19. Prince Of Persia Save Games
    (1)
    Can anybody tell me where the Prince of Persia saved games are located? Every time I format my
    c:\ drive, they are all gone, even when game is located in d:\ It's really frustrating
    playing the game all over again from the beginning. Please help....
  20. Microsoft Video Game Banned For Sex Scene
    The first time it happened to Microsoft. (17)
    News: Microsoft video game banned for sex scene Source:
    http://today.reuters.com/news/articlenews....NGAPORE-BAN.xml What do you think about that, a
    Microsoft video game banned for sex scene, in Singapore, i guess this must be an humiliation, and
    the fact that it is the first it happened to the giant company Microsoft makes it even more hard to
    digest for the Microsoft and for all the people involved on the creation of the Microsoft game,
    namely, "Mass Effect" which is a highly anticipated futuristic space adventure game, a cool game in
    my opinion by the way. I care ....
  21. Background Image Swap Script
    Change a Background Image based on clock time (15)
    Background Image Changer Script To swap the background image from your CSS file according to the
    Server Clock Time. 1.) In your CSS file, add the following rule: CODE body {
        background: url(time.png); } 2.) Create a "folder" named time.png. 3.) Into the
    folder, place three images named morning.png, day.png, night.png. 4.) Also, in the same folder,
    create an index.php file and copy/paste the following script. CODE <?php $hour =
    date('H'); if ($hour < 12 ) {     $image =
    "morning.png"; } ....
  22. How To Save Yourself From A Rape Situation?
    Precautions, Self Defense, Safety Guide (14)
    QUOTE Source : Email - I found this information very necessary for females. How To
    Save Yourself From A Rape Situation? Precautions, Self Defense, Safety Guide Through
    a Rapist's Eyes This is important information for females of ALL ages . A group of
    rapists and date rapists in prison were interviewed on what they look for in a potential victim and
    here are some interesting facts: 1) The first thing men look for in a potential victim is
    hairstyle. They are most likely to go after a woman with a ponytail, bun, braid or other ....
  23. How Do I Make My Own Private Online Server Please Help Me Out.thank You For Your Time.
    (26)
    can someone tell me how to make my very own online private server.Please help me out.This is really
    pissing me off since no one will help me out.Thank you for your time.....
  24. Living Without Computer Today - Is It Possible?,
    How much time "eats" your computer? ;) (36)
    Hello there. My family members keeps annoyingt me becouse of sitting by computer so much. They
    don't care, what am I doing: programming, reading news, posting in forums or reading emails -
    they allways think that I'm just having fun, and it's no use from computer LoL So I decided
    to ask, how much time a day do all of YOU spend sitting by computer? Just trying to find out: 6-8
    hours per day is normal, or I can call myself computer maniac already.......
  25. F19 Stealth Fighter
    The Best Flight Sim Of All Time! PMPL (8)
    I don't think many people know about this great game. Well it was released in 1988 (yes you read
    correctly) by Micrprose inc. I'm sure this game was state-of-the-art when it came out as most
    games are. The graphics aren't too bad, better then I expected but the audio is a problem and
    can be very irratating. Imagine your PC speaker, if you have one, bleeping out the same high pitch
    sqeel for a few minutes - not very pleasent. Missions are good with four difficulty levels - green
    oponents which will never attack you, regular oponents which will make the occassi....
  26. How To Save *.swf From A Web Site?
    freeware or shareware... (30)
    Greetings, Does anyone know how to grab *.SWF file from web? I've found one software named
    LIATRO SWF DECODER.. anyone have tried it? Is it good? Thanks /biggrin.gif' border='0'
    style='vertical-align:middle' alt='biggrin.gif' /> ....
  27. Need 4 Speed Underground 2
    save game (5)
    Does anybody know how you save your game in need 4 speed underground 2 on th game boy advance SP,
    because i cant find a save option. i dont no whether or not if its the game i bought as i got it
    from turkey, and most of them are copies. Its really anoying me because i keep getting so far, but
    then the power runs out, and i have to start again.....
  28. Worst Game Of All Time
    wats the baddest game of all time (64)
    I think the worst game of all time is superman for the nintendo 64 it was so stupid u had to fly
    around these rings in the first mission which made no sense the game itself was poorly done the
    powers were the only good thing and the story made no sense wat so ever so tell me wat u think is
    the worst game of all time and why....
  29. Does Anyone Know Of Any Free Encoding Programs?
    Been searching for a long time... (11)
    Hey, I've been searching for a program that can encode videos. A FREE program. I've searched
    sites such as download.com for a while, but couldn't find one. Anyone know of one? A free trial
    shareware program would work too........
  30. Video Games Are A Complete Waste Of Time, Face It!
    (152)
    C'mon face it, video games are a complete waste of your time! Every time you turn on your
    console you should be asking yourself "Is there something better I should be doing with my time...
    like reading a good book... or watching a good movie... or flirting with a beautiful girl? Do I get
    anything out of this, does this make me a better person?"....

    1. Looking for save, tons, time

*RANDOM STUFF*





*SIMILAR VIDEOS*
Searching Video's for save, tons, time

*MORE FROM TRAP17.COM*
Similar
Google Going Back In Time
Windows Xp Sp2 Restarting After Some Time
Time Travel - An Impossibility? - Is time travel possible? Will we ever manage it? What are the dangers?
Firefox Hates Moveplayer - Help me save my crashing browser.
Spare Time?
The Time Traveller's Wife - Recommendation
Is It Possible To Save Money If You Have Kids? - Credit Tax
Creating A Shortcut List Near The System Tray - Time saver tip for windows
Time Keeps Slipping By - a song i wrote
Why Is The Shoutbox Time Wrong?
Achieve Planner - 30 Trail Time & Project Management Tool
Easy Realmedia Producer - Convert AVI to RMVB to save disk space
Are Airlines Gonna Save The Planet?
Another Cust. Service Rant... This Time As A Customer
Debate With The Religions : Christian Vs Islam Vs More - This time I don't debate, you do
New Sig Girl Here :) - First Time on these Forums
Budding Java Game Developers? - Ever wanted to make your own java web-based game, but not had the time
Firefox 3 Sucks - Time For Another Browser
Prince Of Persia Save Games
Microsoft Video Game Banned For Sex Scene - The first time it happened to Microsoft.
Background Image Swap Script - Change a Background Image based on clock time
How To Save Yourself From A Rape Situation? - Precautions, Self Defense, Safety Guide
How Do I Make My Own Private Online Server Please Help Me Out.thank You For Your Time.
Living Without Computer Today - Is It Possible?, - How much time "eats" your computer? ;)
F19 Stealth Fighter - The Best Flight Sim Of All Time! PMPL
How To Save *.swf From A Web Site? - freeware or shareware...
Need 4 Speed Underground 2 - save game
Worst Game Of All Time - wats the baddest game of all time
Does Anyone Know Of Any Free Encoding Programs? - Been searching for a long time...
Video Games Are A Complete Waste Of Time, Face It!
advertisement



<? Include ?> <iframe/> - This could save me tons of time!



 

 

 

 

ADD REPLY / Got an Opinion! a humble request :-) RAPID SEARCH! Free Hosting [X]
Express your Opinions, Thoughts or Contribute your information that might help someone here.
Ask your Doubts & Queries to get answers.. "Together, We enlight each other!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE