SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Enthusiast
    Join Date
    Nov 2006
    Posts
    62
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    links like /? in php

    Just wondering how to make the links like "/?" in php.. i know the links like .php?id= etc.

  2. #2
    SitePoint Evangelist mrwooster's Avatar
    Join Date
    Jan 2006
    Posts
    518
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    <?php
    echo '<a href="www.link.com/?var=foo">Link</a>';
    ?>

  3. #3
    SitePoint Wizard wheeler's Avatar
    Join Date
    Mar 2006
    Location
    Gold Coast, Australia
    Posts
    1,369
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you would want to be loading an index.php as well by the sounds of it so that the filename is not required in the url
    Studiotime - Time Management for Web Developers
    to-do's, messages, invoicing, reporting - 30 day free trial!
    Thomas Multimedia Web Development

  4. #4
    Non-Member I87's Avatar
    Join Date
    Mar 2006
    Location
    UK
    Posts
    378
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you can only use "/?" links on the index.php file

    though, you could always use switch to redirect people to other pages; or show other pages to the user

    e.g:

    PHP Code:
    <?php
    //index.php

    switch($_GET['c']){

    default:
    $inc 'index2.php';
    break;

    case: 
    'lul':
    $inc 'lul.php';
    break;
    }

    require_once(
    $inc);

    ?>

  5. #5
    SitePoint Enthusiast
    Join Date
    Mar 2007
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    with /? it automaticly assumes that there is an index.php file in the root directory of the domain. If not, you can use mod_rewrite for it! :]

  6. #6
    SitePoint Enthusiast
    Join Date
    Nov 2006
    Posts
    62
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    oh okay , now i understand.. thanks


Bookmarks

Posting Permissions

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