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 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Feb 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Dynamic URL Help

    Okay. I need help with coding my site.
    Say my url to my links page is
    "mysite.com/page/links.php"
    I want the url to be like this
    "mysite.com/index.php?page=links"
    Or
    "mysite.com/?page=links"
    Does anyone know how to code it?
    It's going to have have more than one page.

    Thank You.

  • #2
    New Coder
    Join Date
    Jan 2007
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Code:
    $page = $_GET['page'];
    
    if (empty($page))
     {
    //index.php code
     }
    else
     {
    
      switch ($page)
       {
       case "links":
       require("link.php");
       break;
     
       case "otherpage":
       require("page.php");
       break;
       }
    
     }
    Last edited by papa_face; 02-26-2007 at 01:58 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
    •