+ Reply to Thread
Page 2 of 2 FirstFirst 12
Results 11 to 20 of 20

Thread: [Tutorial PHP] Switching Content / Including Pages

  1. #11
    ZharkD's Avatar
    ZharkD is offline Retired ZharkD is an unknown quantity at this point
    Join Date
    Jan 2008
    Location
    MX
    Posts
    5,914

    Re: [Tutorial PHP] Switching Content / Including Pages

    so, how i can separate each section in main.html?

    for example this main.html:
    This is the main.html

    Title 1
    And all the content from the 1 ^^

    Title 2 //this is other link
    And all the content from the 2

    Title 3 //this is other link
    And all the content from the 3
    How i can separate the links in main.html?
    Thankyou for helpme ^^


    grettings
    salu2

  2. #12
    DarkDragonLord's Avatar
    DarkDragonLord is offline x10 Elder DarkDragonLord is an unknown quantity at this point
    Join Date
    Mar 2007
    Location
    Brazil
    Posts
    782

    Re: [Tutorial PHP] Switching Content / Including Pages

    put in index a menu.
    like this:
    Code:
    <a href="./index.php">index|home</a>
    <a href="./index.php?ddl=2">Link to page 2</a>
    <a href="./index.php?ddl=3">Link to page 3</a>
    main.html
    Code:
    Title 1
    And all the content from the 1 ^^
    This will be shown when ppl enter your site

    2.html
    Code:
    Title 2 //this is other link
    And all the content from the 2


    3.html
    Code:
    Title 3 //this is other link
    And all the content from the 3


    like this
    Regards,
    Raphael DDL

    Designing Solutions for You
    *Web Design;
    *Coding;
    Free Downloads;
    and all related Stuff
    .


    My Tutorials:
    | Multi-Language Websites | Rotative Banners |
    | Bookmark Script for All Browsers
    |
    |
    PHP Switching/Including Content|
    |


  3. #13
    ZharkD's Avatar
    ZharkD is offline Retired ZharkD is an unknown quantity at this point
    Join Date
    Jan 2008
    Location
    MX
    Posts
    5,914

    Re: [Tutorial PHP] Switching Content / Including Pages

    omg thankyou, so if the page 2 is named "demo.html" in the link i need put "/index.php?ddl=demo" ?

    Thankyou for this tutorial is very userfull ^^


    grettings
    salu2
    Last edited by ZharkD; 03-30-2008 at 07:26 PM.

  4. #14
    galaxyAbstractor's Avatar
    galaxyAbstractor is offline Community Advocate galaxyAbstractor is on a distinguished road
    Join Date
    Oct 2007
    Location
    Land of Null and Insanity
    Posts
    5,490

    Re: [Tutorial PHP] Switching Content / Including Pages

    How do I change page title and metatags per page when doing this?

    lol nvm, found out a way. I don't include anything exept the php code in the main file and I put the meta tags in the template.
    Edit:
    Whats wrong with:

    PHP Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <?php
    if ($_GET['id'])
    if (
    file_exists('./template/'.$_GET['id'].'.html'))
    @include(
    $_GET['id'].'.html');
    else
    @include(
    './error.html');
    else
    @include (
    "./index.php");
    ?> 
    </body>
    </html>
    it doesen't include anything...

    the source in game.php when accessing it with a browser is:

    HTML Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
    </body>
    </html>
    Edit:
    nvm, got it working
    Last edited by galaxyAbstractor; 04-27-2008 at 12:32 PM. Reason: Automerged Doublepost

  5. #15
    DarkDragonLord's Avatar
    DarkDragonLord is offline x10 Elder DarkDragonLord is an unknown quantity at this point
    Join Date
    Mar 2007
    Location
    Brazil
    Posts
    782

    Re: [Tutorial PHP] Switching Content / Including Pages

    Quote Originally Posted by vigge_sWe View Post
    How do I change page title and metatags per page when doing this?

    lol nvm, found out a way. I don't include anything exept the php code in the main file and I put the meta tags in the template.
    Edit:
    Whats wrong with:

    PHP Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <?php
    if ($_GET['id'])
    if (
    file_exists('./template/'.$_GET['id'].'.html'))
    @include(
    $_GET['id'].'.html');
    else
    @include(
    './error.html');
    else
    @include (
    "./index.php");
    ?> 
    </body>
    </html>
    it doesen't include anything...

    the source in game.php when accessing it with a browser is:

    HTML Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
    </body>
    </html>
    Edit:
    nvm, got it working
    i think its missing a <body> after </head> lol
    Regards,
    Raphael DDL

    Designing Solutions for You
    *Web Design;
    *Coding;
    Free Downloads;
    and all related Stuff
    .


    My Tutorials:
    | Multi-Language Websites | Rotative Banners |
    | Bookmark Script for All Browsers
    |
    |
    PHP Switching/Including Content|
    |


  6. #16
    galaxyAbstractor's Avatar
    galaxyAbstractor is offline Community Advocate galaxyAbstractor is on a distinguished road
    Join Date
    Oct 2007
    Location
    Land of Null and Insanity
    Posts
    5,490

    Re: [Tutorial PHP] Switching Content / Including Pages

    Quote Originally Posted by DarkDragonLord View Post
    i think its missing a <body> after </head> lol
    Hah! And 2 <head> tags! Weird that it still works properly in both IE and FF...

  7. #17
    DarkDragonLord's Avatar
    DarkDragonLord is offline x10 Elder DarkDragonLord is an unknown quantity at this point
    Join Date
    Mar 2007
    Location
    Brazil
    Posts
    782

    Re: [Tutorial PHP] Switching Content / Including Pages

    Quote Originally Posted by vigge_sWe View Post
    Hah! And 2 <head> tags! Weird that it still works properly in both IE and FF...


    They try 'help' people lol xD
    Regards,
    Raphael DDL

    Designing Solutions for You
    *Web Design;
    *Coding;
    Free Downloads;
    and all related Stuff
    .


    My Tutorials:
    | Multi-Language Websites | Rotative Banners |
    | Bookmark Script for All Browsers
    |
    |
    PHP Switching/Including Content|
    |


  8. #18
    xiadow001 is offline x10Hosting Member xiadow001 is an unknown quantity at this point
    Join Date
    Apr 2008
    Posts
    23

    Re: [Tutorial PHP] Switching Content / Including Pages

    mind if I bring this up again?? uhhmm... just wondering what's the use of this..



    <a href="?ddl=porfolio&ports=videos" />videos</a>



    coz i dont understand why there are two variables..... the ddl and ports .. where does the value of ddl go....:drool:

  9. #19
    galaxyAbstractor's Avatar
    galaxyAbstractor is offline Community Advocate galaxyAbstractor is on a distinguished road
    Join Date
    Oct 2007
    Location
    Land of Null and Insanity
    Posts
    5,490

    Re: [Tutorial PHP] Switching Content / Including Pages

    maybe the file is called "portfolio&ports=video"? lol. It isn't in the main code...

  10. #20
    DarkDragonLord's Avatar
    DarkDragonLord is offline x10 Elder DarkDragonLord is an unknown quantity at this point
    Join Date
    Mar 2007
    Location
    Brazil
    Posts
    782

    Re: [Tutorial PHP] Switching Content / Including Pages

    Quote Originally Posted by xiadow001 View Post
    mind if I bring this up again?? uhhmm... just wondering what's the use of this..



    <a href="?ddl=porfolio&ports=videos" />videos</a>



    coz i dont understand why there are two variables..... the ddl and ports .. where does the value of ddl go....:drool:

    ur saying in my website?
    because ddl=portfolio called the portfolio.html and inside portfolio.html have a code that, if is declared another variable, called ports, it get the html's that refer to the portfolio sections. If no ports are found, is shows the portfolio main menu.

    just that..

    But i stopped using that, too much things to set when using that. So, now i have a better way.. i did a portfolio folder and inside it, the sections.. so i call ddl=porfolio/videos and it call the video.html inside the porfolio folder xD
    Last edited by DarkDragonLord; 05-29-2008 at 02:25 PM.
    Regards,
    Raphael DDL

    Designing Solutions for You
    *Web Design;
    *Coding;
    Free Downloads;
    and all related Stuff
    .


    My Tutorials:
    | Multi-Language Websites | Rotative Banners |
    | Bookmark Script for All Browsers
    |
    |
    PHP Switching/Including Content|
    |


+ Reply to Thread
Page 2 of 2 FirstFirst 12

Similar Threads

  1. Urgent help please!
    By retro-bliss in forum Free Hosting
    Replies: 2
    Last Post: 10-25-2007, 04:24 PM
  2. help-add content to all pages at once
    By andhrafun in forum Scripts & 3rd Party Apps
    Replies: 3
    Last Post: 09-19-2007, 04:41 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers