Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1
    Join Date
    Apr 2007
    Posts
    2,431
    Tokens
    0

    Latest Awards:

    Default PHP Include help

    Hey,

    So, i have my index which includes a file called 'Appmenu.php'.

    In Appmenu, is:
    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" />
    <
    title>Dunt need one :)</title>
    </
    head>

    <
    body>
    Please select the department you would like to be a part of:
    <
    p>
    <
    p>
    <
    a href="radio.php">Radio Department</a>
    <
    a href="news.php">News Department</a>
    <
    a href="events.php">Events Department</a>
    </
    body>
    </
    html
    So, how do I make it the links load into the same include Appmenu is, as these links simply open new pages.

    +rep for any help,

    Cheers

    [X] [X] [X]

  2. #2
    Join Date
    May 2005
    Location
    Burgessville
    Posts
    806
    Tokens
    0

    Default

    put it in the appmenu file? or I missunderstood what your asking..

    Originally Posted by bananasislegend
    this thread might be better than sex..

  3. #3
    Join Date
    Feb 2005
    Posts
    2,503
    Tokens
    0

    Latest Awards:

    Default

    Please delete, sorry.
    Last edited by Matt.; 19-08-2008 at 12:34 AM.

  4. #4
    Join Date
    Apr 2007
    Posts
    2,431
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by madchild24 View Post
    put it in the appmenu file? or I missunderstood what your asking..
    Okay, I have index.php, and that includes Appmenu.php

    Appmenu is meant to have links to categories, and when clicked (the links), they should load into the same include Appmenu.php is, in index.php

    ?

    [X] [X] [X]

  5. #5
    Join Date
    Mar 2008
    Posts
    5,108
    Tokens
    3,780

    Latest Awards:

    Default

    PHP does not work like an iframe, they are not going to load by themselves like iframes do.

  6. #6
    Join Date
    Nov 2007
    Posts
    1,253
    Tokens
    150

    Latest Awards:

    Default

    1 word. Ajax.

    another. Scripaculous.

    2 words. Ajax.Updater


    www.fragme.co = a project.

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

    Latest Awards:

    Default

    Im not quite sure what you mean, but give this a go

    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" />
    <title>Dunt need one :)</title>
    </head>

    <body>
    Please select the department you would like to be a part of:
    <p>
    <p>
    <a href="index.php?p=radio">Radio Department</a>
    <a href="index.php?p=news">News Department</a>
    <a href="index.php?p=events">Events Department</a>
    <?php
    if ( isset ( $_GET['p'] ) ) {
       
    $p addslashes $_GET['p'] );
       
    $p .= ".php";
          if ( 
    file_exists $p ) ) {
             include ( 
    $p );
          }
          else {
             echo 
    "cannot find file";
          }
    }
    else {
       echo 
    "Please choose a department above";
    }
    ?>
    </body>
    </html>
    Im not 100% sure that will work as i've just wrote it out now and its not tested, but give it a try
    Lets set the stage on fire, and hollywood will be jealous.

  8. #8
    Join Date
    Apr 2007
    Posts
    2,431
    Tokens
    0

    Latest Awards:

    Default

    That works great! The links are still there but oh well

    +rep (if can)

    [X] [X] [X]

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

    Latest Awards:

    Default

    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" />
    <title>Dunt need one :)</title>
    </head>

    <body>
    <?php
    if ( isset ( $_GET['p'] ) ) {
       
    $p addslashes $_GET['p'] );
       
    $p .= ".php";
          if ( 
    file_exists $p ) ) {
             include ( 
    $p );
          }
          else {
             echo 
    "cannot find file";
          }
    }
    else {
       echo 
    'Please select the department you would like to be a part of:
    <p>
    <p>
    <a href="index.php?p=radio">Radio Department</a>
    <a href="index.php?p=news">News Department</a>
    <a href="index.php?p=events">Events Department</a>'
    ;
    }
    ?>
    </body>
    </html>
    If you want the links removed use this code
    Lets set the stage on fire, and hollywood will be jealous.

  10. #10
    Join Date
    Apr 2007
    Posts
    2,431
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Tom743 View Post
    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" />
    <title>Dunt need one :)</title>
    </head>

    <body>
    <?php
    if ( isset ( $_GET['p'] ) ) {
       
    $p addslashes $_GET['p'] );
       
    $p .= ".php";
          if ( 
    file_exists $p ) ) {
             include ( 
    $p );
          }
          else {
             echo 
    "cannot find file";
          }
    }
    else {
       echo 
    'Please select the department you would like to be a part of:
    <p>
    <p>
    <a href="index.php?p=radio">Radio Department</a>
    <a href="index.php?p=news">News Department</a>
    <a href="index.php?p=events">Events Department</a>'
    ;
    }
    ?>
    </body>
    </html>
    If you want the links removed use this code
    Thanks!

    I need a bit more help,

    Index.php has that, then that links to radio.php, so how do I make the links in radio.php do that?

    I'dve tried both aboves but it just forever expands ^^

    +rep for any help (unless its tom again I'd owe)
    Last edited by Pazza; 19-08-2008 at 11:42 AM.

    [X] [X] [X]

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
  •