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 16

Thread: Php Links

  1. #1
    Join Date
    Jul 2004
    Location
    Webby Forums!
    Posts
    1,879
    Tokens
    0

    Latest Awards:

    Default Php Links

    Before the old forum was cleared there was a thread explaining how to change content in a Text box without having to change the WHOLE page! Here is where I insert my main content using this code:

    <?PHP
    include("home.php");
    ?>

    so... how do I change this content so new stuff will appear. Abit like with an iframe <a href=home.php target=main> how do i do it? :S


    Chilimagik.net // Reviews, Band Biographies, News, Pics + Loads More!!
    [Thybag.co.uk - Vive la revolutione]

  2. #2
    Join Date
    Jul 2004
    Location
    I'm not quite sure.......
    Posts
    771
    Tokens
    0

    Default

    Code:
    <a target="I1" href="PAGE NAME HERE">TEXT HERE</a>
    The I1 is short for iFrame 1. same if you had 3 iFrames. There would be I1 - which would be the first one you put in. I2 - which would be the second one you put in. And I3 - which, obviously, would be the 3rd one you put in. Hope this helps.
    Join My Forum

  3. #3
    Join Date
    Aug 2004
    Location
    UK
    Posts
    11,283
    Tokens
    2,031

    Latest Awards:

    Default

    oh this is quite easy.

    What you want to do is dinamicly chnage the contents of a sites, via php.

    basicly you just use the if statemnt


    <?php

    if($go=="linkname")
    {
    include("linkname.php");
    }
    elseif($go=="linkname2")
    {
    include("linkname2.php");
    }
    else
    {
    include("home.php");
    }
    ?>
    The set up links to say. if the page is index.php

    index.php?go=pagename

    <a href="index.php?go=pagename">link </a>

    and if page name is equle to one of the else if statements it will include that page. If its not it will incude the page after the else.

    just ad else if statmnts, after the firest else if to add more links.

    hope that helps
    Last edited by Mentor; 26-02-2005 at 02:44 PM.

  4. #4
    Join Date
    Jul 2004
    Location
    Webby Forums!
    Posts
    1,879
    Tokens
    0

    Latest Awards:

    Default

    OMG! Thank you so much I was about to give up as I have been asking all day Thanks Ive given some rep


    Chilimagik.net // Reviews, Band Biographies, News, Pics + Loads More!!
    [Thybag.co.uk - Vive la revolutione]

  5. #5
    Join Date
    Oct 2004
    Location
    Scotland
    Posts
    2,280
    Tokens
    1,075

    Latest Awards:

    Default

    lol, this stuff is beyond me

    http://www.stupidian.com
    (contains mild swearing)

  6. #6
    Join Date
    Jul 2004
    Location
    Webby Forums!
    Posts
    1,879
    Tokens
    0

    Latest Awards:

    Default

    I dont understand it But it works


    Chilimagik.net // Reviews, Band Biographies, News, Pics + Loads More!!
    [Thybag.co.uk - Vive la revolutione]

  7. #7
    Join Date
    Aug 2004
    Location
    UK
    Posts
    11,283
    Tokens
    2,031

    Latest Awards:

    Default

    its quite simple realy

    PHP Code:
    <?php
    invokes php, aka gets it to prosses wahts inside the tag

    PHP Code:
    if($go=="linkname")
    {
    include(
    "linkname.php");

    Then teh if fucntion comes in to play/

    $go

    is a varibale, and in this case is set by the url aka index.php?go=linkname

    basicly means go is equal to link name.

    now the if function comes along and IF linkname is equal to is equal to linkname, then it does what evers inbetween teh {} tags

    If its not it ignos that part and moves on to the elseif

    which works exsactly the same as the if, exspt its in the same function, and you can add as many as you wnat of them
    PHP Code:
    elseif($go=="linkname2")
    {
    include(
    "linkname2.php");

    then the last part of the script is the Else option, which means if the varible is equl to none of the if or elseif statemnts, it will print this
    PHP Code:
    else
    {
    include(
    "home.php");

    then the ?> tag simply tell it to stop invoking php

    PHP Code:
    ?> 
    simple huh?


    edit:

    And the bit i fogot to mention. The include tag simply gets all the data from the page its incling and dumps it in to the one tahst incluing it

  8. #8
    Join Date
    Oct 2004
    Location
    Scotland
    Posts
    2,280
    Tokens
    1,075

    Latest Awards:

    Default

    so the "if($go=="linkname")
    {
    include("linkname.php");
    }"


    Will turn out as hyper links? What is the actual point in doing this? I just dont understand :@

    http://www.stupidian.com
    (contains mild swearing)

  9. #9
    Join Date
    Jul 2004
    Location
    Bournemouth. UK
    Posts
    3,638
    Tokens
    0

    Latest Awards:

    Default

    yer lol just use html foo's why make it complicated!!!
    REMOVED

    Edited by jesus (Forum Super Moderator): Please do not have text in your signature which is over size 4.

  10. #10
    Join Date
    Jul 2004
    Location
    Webby Forums!
    Posts
    1,879
    Tokens
    0

    Latest Awards:

    Default

    Cos I dont like iframes and this script makes it look alot nices Thanks mentor and the
    "if($go=="linkname")
    {
    include("linkname.php");
    }"
    dosent make a link


    Chilimagik.net // Reviews, Band Biographies, News, Pics + Loads More!!
    [Thybag.co.uk - Vive la revolutione]

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
  •