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

Pages: 1, 2, 3
free web hosting
Free Web Hosting, No Ads > CONTRIBUTE > Computers > Programming Languages > PHP Programming

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

Joshthegreat
Sorry for double post. Well, All works fine apart from this www.cell.trap17.com/trick-tips.php
The links on the left of the page work fine and do as described by no9t9, but how do I get rid of the weird looking stuff? Help?

Reply

no9t9
your url does not have the ?load=whatever.html part. This means that the include($load); command is loading nothing which will give you an error. You need to load something.

change the line <?php include($load); ?> to
<?php if ($load!="") include($load); ?>

this new line will basically only load content IF you have specified it in the URL. If there is no ?load=whatever.html, you will simply get a nothing in the content area.

if you want you can add HTML code there instead of leaving it blank.

<?php if($load!="") include($load);
else { ?>
<YOUR OWN HTML CODE>
<?php } ?>

With the above code, if $load is not specified in the URL, it will display <YOUR OWN HTML CODE>

adding one more thing,
<?php if($load!="" && file_exists($load)) include($load);
else { ?>
<YOUR OWN HTML CODE>
<?php } ?>

this checks that $load is specified in the URL and also checks to see if what you specified exists. If not, it displays <YOUR OWN HTML CODE>

 

 

 


Reply

Joshthegreat
Thanks, I'll use the first one though, the others all look a bit complicated. Thanks again for your help.

Reply

FaLgoR
Try to use this code I've made some months ago:

CODE

<?
if(!$area) // If the area is not specified
$area= 'main'; // go to the main page

if(strstr($area,"//") || strstr($area,"\/")) // If someone try to hack the sistem
die("The page you request was not found on this server."); // Stop all
if(!file_exists("$area.html")) // If the page does not exists
die("The page you request was not found on this server."); // stop all and send an error message
else // if it does
include("$area.html"); // include the specified page
?>


Put this code where you want the "iframe", and the main page will be called main.html. Hope it helped you smile.gif

Reply

no9t9
yes hacking is an issue and I also have used code to check for slashes, etc.

I made a webpage using similar method. BAsically one template file which loads content a conent file. I find that this is not the best way to layout a site. I find it is better to include the layout from a file rather than the content.

basically like this

include banner.html;
include navigation.html;
<content code here>
include footer.html;

I think this method is actually better because each page is easier to customize.

Reply

FaLgoR
QUOTE(no9t9 @ Apr 9 2005, 04:17 PM)
yes hacking is an issue and I also have used code to check for slashes, etc.

I made a webpage using similar method.  BAsically one template file which loads content a conent file.  I find that this is not the best way to layout a site.  I find it is better to include the layout from a file rather than the content.

basically like this

include banner.html;
include navigation.html;
<content code here>
include footer.html;

I think this method is actually better because each page is easier to customize.
*



Yes, I make my pages just like you.
<?
include("top.html");
include("content.html");
include("bottom.html");
?>

I don't know what would I do without php... When the site is updated, I would have to change every page, everything, many times.... :T

Reply

no9t9
yup, because of PHP it is so easy to change layouts. I can just make changes in one place and my whole site is updated. It is very convenient. I used to use PERL but I find PHP is easier to program cause it is so similar to C. I also make my own image galleries in PHP. Like 10 or so lines of code will be able to do UNLIMITED image galleries. It is amazing.

Reply

Amezis
Well, I don't really know anything about php, and I can't get it to work tongue.gif

Here's the code I tried
CODE

<body>

<p align="center">
<img border="0" src="logo.gif" width="500" height="100"></p>

<table border="1" cellspacing="1" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
 <tr>
   <td width="13%">MENU<p>link1<br>
   link2<br>
   link3<br>
   link4</td>
   <td width="87%" valign="top"><?php include($load); ?></td>
 </tr>
</table>

</body>

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

Reply

mobious
but for me, the best way to go is to use a template system so that html tags are seperated from your php codes.

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.
Confirm Code:

Pages: 1, 2, 3
Recent Queries:-
  1. iframe include - 33.31 hr back. (1)
  2. php iframes or include - 56.01 hr back. (1)
  3. include part of page iframe - 61.65 hr back. (1)
  4. pp include iframe - 72.97 hr back. (1)
  5. telling navigation to load in only 1 div - 73.50 hr back. (1)
  6. html iframe include - 81.76 hr back. (1)
  7. two iframes on same page each onclick show - 95.10 hr back. (1)
  8. include more than one file in iframe - 100.17 hr back. (1)
  9. php load page in frame - 113.43 hr back. (1)
  10. php include or iframe - 118.05 hr back. (1)
  11. html iframes faster than php include - 120.98 hr back. (1)
  12. a page include an iframe - 129.55 hr back. (1)
  13. include php in an iframe - 135.58 hr back. (2)
  14. html include iframe - 148.03 hr back. (2)
Similar Topics

Keywords : save, tons, time

  1. Time Keeps Slipping By
    a song i wrote (0)
  2. 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....
  3. 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 ....
  4. 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.....
  5. Are Airlines Gonna Save The Planet?
    (9)
    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....
  6. Date Time Lights Temp And Timer, It's Go It All
    (0)
    Here is MY review of this fantastic little clock that I got from China. I was a little worried
    buying from a company that was all the way in China, www.LDUcompany.com but everything went real
    well and may new clock was delivered in less time then they had said. I had first emailed them a few
    times with a bunch of questions and they answered every one of my emails quickly. This clock is
    really neat, every time you flip it on a different side it changes what it tells you and lights up
    and starts flashing in different colors. It is built very well and it is not cheap jun....
  7. Story Time!
    A Story I Wrote in Sixth Grade (2)
    I called it Kureshi's Tale, and I submitted it in this writing contest in sixth grade. Looking
    back on it now, it is absolutely horrible. It was the longest thing I had ever written at the time,
    but since then I've participated in NaNoWriMo. What are your opinions? Part I: PROLOGUE
    Kureshi was born in the Birthing Cave, 12 falls ago, on November 10. The Birthing Cave was the most
    sacred place to be brought into the world through from Heaven. It was considered to be magical, to
    wish your newborn child good luck when they entered this world. Kureshi’s Paren....
  8. Another Cust. Service Rant... This Time As A Customer
    (5)
    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....
  9. Debate With The Religions : Christian Vs Islam Vs More
    This time I don't debate, you do (16)
    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....
  10. Save Me!
    Religious (0)
    During exams, with all the stress, my brain explodes, I need to turn to God for help. I've
    been thinking I'm able. I've been thinking I'm good enough. I've been thinking
    I'll make it on my own. I've been seeking my kingdom. I've been longing for my own
    thing. I've been trying my best to take control. But without you I crumble. Without you
    I'm lost. Save me, Jesus Won't you take my pride away. Save me, Jesus Today Give me
    eyes that can see you Patient heart and a gentle word Love for justice, mercy, pea....
  11. 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 ....
  12. Budding Java Game Developers?
    Ever wanted to make your own java web-based game, but not had the time (9)
    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?....
  13. Firefox 3 Sucks - Time For Another Browser
    (61)
    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....
  14. Trap17 Forums: Is It Time For A Clean Out?
    ...yes, if I say so... (25)
    Due to the overwhelming amount of topics and posts etc., I think Trap17 should have a trim of all
    its clutter. And if we go to a further extent reorganising the forums and possibly getting a rid of
    few. This is only my point of view but what do you think?....
  15. 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....
  16. 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 ....
  17. 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"; } ....
  18. How To Save Yourself From A Rape Situation?
    Precautions, Self Defense, Safety Guide (13)
    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 ....
  19. Reducing Windows Vista Start Menu Programs Response Time.
    How to do it. (4)
    If you have been using Microsoft Windows Vista for quite some time, you would have noticed that
    installing a number of programs/softwares into your computer considerably slows down the response
    time of your start menu program folder, sometimes up to one second or more before the programs
    listed in a particular start menu folder is displayed. Worst of all, if you are trying to launch a
    program from you start menu which is within another start menu prrograms folder. Well, I have found
    a way to bypass this very annoying thing in Windows Vista. I have about 98 start menu en....
  20. 25 Of The Best Computer Hoaxes Of All Time
    (5)
    I have to admit I only seen a few of these of course our favior nigerian scam was in on the list as
    well, best part they have links to whats was wrong with everyone of these hoaxes. Of course I have
    to admit these were some pretty funny ones, especially the cell phone tracer. what I recommend for
    a phone number is 000-0000000 and you will be safe from any problems in the future and also care to
    look how how to stupid some Nigerian scammers are? check this link out and read the emails and the
    foot notes to these emails http://www.scamorama.com/bunyan.html . Those of ....
  21. 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.....
  22. Living Without Computer Today - Is It Possible?,
    How much time "eats" your computer? ;) (25)
    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.......
  23. Time Viewing
    (14)
    Einstein once proved time travel impossible but never said anything about time viewing i bielive so
    i posted this to see if anyone has opinions i can feed off of about either a)do you think time
    viewing will ever be possible and if so your theory or b)do you not agree with Einstein and think
    time travel wil one day be possible and if so your theory....
  24. Poll: Best Games Of All Time!
    Bets games ever! (55)
    Witch game do you think strated it all? we are talking just gaming in general, witch game do you
    enjoy the most? Witch game is most addicting to you? (ermm wow /tongue.gif' border='0'
    style='vertical-align:middle' alt='tongue.gif' /> ) im excited to see the results! Also is you
    dont like any games here post your fav! Merged two posts ....
  25. 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' /> ....
  26. Need 4 Speed Underground 2
    save game (4)
    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.....
  27. Worst Game Of All Time
    wats the baddest game of all time (60)
    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....
  28. 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........
  29. Your All-time Worst Book
    Your all-time worst book (26)
    What is the worst book you've ever read and why?....
  30. Video Games Are A Complete Waste Of Time, Face It!
    (146)
    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
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?
Date Time Lights Temp And Timer, It's Go It All
Story Time! - A Story I Wrote in Sixth Grade
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
Save Me! - Religious
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
Trap17 Forums: Is It Time For A Clean Out? - ...yes, if I say so...
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
Reducing Windows Vista Start Menu Programs Response Time. - How to do it.
25 Of The Best Computer Hoaxes Of All Time
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? ;)
Time Viewing
Poll: Best Games Of All Time! - Bets games ever!
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...
Your All-time Worst Book - Your all-time worst book
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 more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
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