Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 10 of 10
  1. #1
    Regular Coder
    Join Date
    Jan 2010
    Posts
    127
    Thanks
    9
    Thanked 0 Times in 0 Posts

    pHp website help

    Hi guys,

    i wanted to make a php website but im still new on all of this, i want to ask how do i make my php website like this?

    /index.php?site=news

    i dont get how they do it... i can make a index.php but "?site=news" is what? any tutorial for me? so i know how to make this kind of website

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,861
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    New Coder
    Join Date
    Mar 2010
    Posts
    26
    Thanks
    3
    Thanked 1 Time in 1 Post
    Basically there isn´t much difference between

    /index.php?site=news

    and

    /news/somefile.php

    While the second solution simply accesses the file somefile.php, the first solution has in its index.php an if() or switch, checking something like

    Code:
    if($_GET['site'] == "news")
    {
    include("/news/somefile.php");
    }
    The advantage of this is, that the index.php can include other stuff, like checking login or cookies, loading a menu, etc., before including the page.

  • #4
    Regular Coder
    Join Date
    Jan 2010
    Posts
    127
    Thanks
    9
    Thanked 0 Times in 0 Posts
    i see.. i hope i can sort it all with both of your answer, i will come back here if i cant figure it out

    thanks alot guys

  • #5
    Regular Coder
    Join Date
    Jan 2010
    Posts
    127
    Thanks
    9
    Thanked 0 Times in 0 Posts
    sorry to bump old topic but i saw some website got this kind of extention.

    example:
    http://www.facebook.com/#!/?ref=logo
    http://teamlz.com/home/?p=1235

    what is the different between above link and

    http://www.example.com/index.php?page=test

    sorry for asking this dumb question but i hope someone can make me clear what is that diffrent

  • #6
    Senior Coder
    Join Date
    Aug 2009
    Location
    Mansfield, Nottinghamshire, UK
    Posts
    1,555
    Thanks
    57
    Thanked 148 Times in 147 Posts
    index is always processed if present .co.uk/ is the same as .co.uk/index.php also .co.uk/index.php?foo=bar is the same as .co.uk/?foo=bar

    And for a guess ( not realy know ) #!/ can be applied to any url and is related to the name of an anchor.
    Last edited by Phil Jackson; 05-08-2010 at 03:52 PM.
    Website Design Mansfield
    PHP Code:
    function I_LOVE(){function b(&$b='P'){$b.='P';}function a($_){return $_++;}$b='P';define("B",'H');b($b=implode('',array($b=a($b),$b=a(B))));b($b);return $b;}
    echo 
    I_LOVE(); 

  • #7
    Regular Coder
    Join Date
    Jan 2010
    Posts
    127
    Thanks
    9
    Thanked 0 Times in 0 Posts
    then how to hide the index.php from the broswer? i mean like how to do from

    http://www.example.com/index.php?page=test

    to

    http://www.example.com/?page=test

  • #8
    met
    met is offline
    Regular Coder
    Join Date
    Oct 2009
    Location
    United Kingdom
    Posts
    728
    Thanks
    4
    Thanked 119 Times in 119 Posts

  • #9
    Senior Coder
    Join Date
    Aug 2009
    Location
    Mansfield, Nottinghamshire, UK
    Posts
    1,555
    Thanks
    57
    Thanked 148 Times in 147 Posts
    Code:
    <a href="./?foo=bar">link</a>
    Website Design Mansfield
    PHP Code:
    function I_LOVE(){function b(&$b='P'){$b.='P';}function a($_){return $_++;}$b='P';define("B",'H');b($b=implode('',array($b=a($b),$b=a(B))));b($b);return $b;}
    echo 
    I_LOVE(); 

  • Users who have thanked Phil Jackson for this post:

    lazyserv (05-08-2010)

  • #10
    Regular Coder
    Join Date
    Jan 2010
    Posts
    127
    Thanks
    9
    Thanked 0 Times in 0 Posts
    fastest solution! thank phil
    u really is my master ^^


  •  

    Posting Permissions

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