Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Join Date
    Aug 2007
    Posts
    192
    Tokens
    3,120

    Latest Awards:

    Default Including .html files in a .php? +Rep!!!

    Hey there guys,

    I need a html included in a php. For example:

    You click a link on the navigation menu and the html appears on the homepage, like www.HabbVillage.co.uk.

    +Rep up for grabs!
    www.habbmania.co.uk >> Send me a pm if you need a habbo fansite job!


    Check out some of my videos!

  2. #2
    Join Date
    Mar 2008
    Location
    Swindon, UK
    Posts
    1,274
    Tokens
    187
    Habbo
    :Ltd

    Latest Awards:

    Default

    You can include HTML in php pages outside the <?php ?> tags.

    <?php
    echo("Hi");
    ?>
    <html>
    <head>
    <title>ImDumb</title>
    </head>
    <body>
    lalala
    </body>
    </html>
    Hi, names James. I am a web developer.

  3. #3
    Join Date
    Feb 2007
    Location
    Essex, England
    Posts
    1,392
    Tokens
    0

    Latest Awards:

    Default

    That site is using an iframe to make content appear.

    You can tell cos otherwise there'd be a url like
    http://www.sitename.com/something.php?page=666

    Try this:

    http://www.dynamicdrive.com/dynamici...iframessi2.htm


  4. #4
    Join Date
    Dec 2006
    Posts
    3,970
    Tokens
    0

    Latest Awards:

    Default

    Make a folder called files and then, add your html files to it.

    Use this php code to display them
    PHP Code:
    Your layout code here
    <a href="index.php?page=home">Home</a>
    <a href="index.php?page=guides">Guides</a>
    <?php
    $Page 
    $_GET["page"];
    include(
    "files/$Page.html");
    ?>
    Your layout code here
    So to make that code work you would need a file called home.html and a file called guides.html

    Lets set the stage on fire, and hollywood will be jealous.

  5. #5
    Join Date
    Mar 2008
    Location
    England, Cheshire.
    Posts
    173
    Tokens
    0

    Default

    try this:

    <iframe src="widthhere%" height="heighthere%" src="URL/TO/FILE" frameborder="0" />

    try that =]

  6. #6

    Default

    Quote Originally Posted by IntaMedia View Post
    try this:

    <iframe src="widthhere%" height="heighthere%" src="URL/TO/FILE" frameborder="0" />

    try that =]
    should be
    <iframe src="widthhere%" height="heighthere%" src="URL/TO/FILE" frameborder="0"></iframe>
    iframe has a closing tag :]

    anyway..
    PHP Code:
    <?php
    $page 
    $_GET['page'];
    if(!isset(
    $page))
    {
    include(
    "home.php");//Home page..
    }
    else if(
    file_exists("" $page ".php"))
    {
    include(
    "" $page ".php");
    }
    else
    {
    echo(
    "<h1>Error..</h1>The file <strong>" $page ".php</strong> was not found.");
    }
    ?>
    then you'd just use this for your hyperlinks.
    HTML Code:
    <a href="?page=home">Home</a>
    <!-- Links to home.php -->
    <a href="?page=news">News</a>
    <!-- Links to news.php -->
    That should do what you're looking for?

  7. #7
    Join Date
    Aug 2007
    Posts
    192
    Tokens
    3,120

    Latest Awards:

    Default

    Jme gots +rep
    www.habbmania.co.uk >> Send me a pm if you need a habbo fansite job!


    Check out some of my videos!

  8. #8
    Join Date
    Dec 2007
    Posts
    1,683
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by IntaMedia View Post
    try this:

    <iframe src="widthhere%" height="heighthere%" src="URL/TO/FILE" frameborder="0" />

    try that =]
    Iframes are total crap, even though must ajax is by iframe, I prefer includes..

    And you can just include .html files within php anyway?
    PHP Code:
    <?php
    // Include file below
    include('page.html');
    ?>

  9. #9
    Join Date
    Nov 2006
    Location
    Liverpool/Manchester
    Posts
    2,457
    Tokens
    0

    Latest Awards:

    Default

    do it by includes Much better
    Joe


  10. #10
    Join Date
    Mar 2008
    Posts
    779
    Tokens
    0

    Default

    Thing is I bet you're making a radio fansites or something. If you're making a radio fansite they PHP includes are no use to you. You'll either have to use AJAX or an iFrame.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •