Question on php questionmark variables but slash instead

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • pspauthority@gmail.com

    #1

    Question on php questionmark variables but slash instead

    Hello.

    I've noticed in MediaWiki (the software used by Wikipedia.org) uses
    forward-slashes "/" some of the time to organize the different items.

    example



    notice the

    index.php/Main_Page

    it uses a slash, rather than a question mark.

    can someone please show me how to do this myself? It'd be appreciated

    thanks

  • Rik

    #2
    Re: Question on php questionmark variables but slash instead

    pspauthority@gm ail.com wrote:[color=blue]
    > Hello.
    >
    > I've noticed in MediaWiki (the software used by Wikipedia.org) uses
    > forward-slashes "/" some of the time to organize the different items.
    >
    > example
    >
    > http://www.zeldarealm.com/zeldapedia....php/Main_Page
    >
    > notice the
    >
    > index.php/Main_Page
    >
    > it uses a slash, rather than a question mark.
    >
    > can someone please show me how to do this myself? It'd be appreciated[/color]

    Easiest are RewriteRules in .htaccess files.

    Grtz,
    --
    Rik Wasmus


    Comment

    • Janwillem Borleffs

      #3
      Re: Question on php questionmark variables but slash instead

      pspauthority@gm ail.com wrote:[color=blue]
      > notice the
      >
      > index.php/Main_Page
      >
      > it uses a slash, rather than a question mark.
      >
      > can someone please show me how to do this myself? It'd be appreciated
      >[/color]

      You can parse the $_SERVER['REQUEST_URI'] variable and, per example, parse
      it as follows:

      $arg = substr(
      $_SERVER['REQUEST_URI'],
      1 + strrpos($_SERVE R['REQUEST_URI'], '/')
      );


      JW


      Comment

      • Andy Jeffries

        #4
        Re: Question on php questionmark variables but slash instead

        On Tue, 02 May 2006 11:55:04 -0700, pspauthority wrote:
        [color=blue]
        > Hello.
        >
        > I've noticed in MediaWiki (the software used by Wikipedia.org) uses
        > forward-slashes "/" some of the time to organize the different items.
        >
        > example
        >
        > http://www.zeldarealm.com/zeldapedia....php/Main_Page
        >
        > notice the
        >
        > index.php/Main_Page
        >
        > it uses a slash, rather than a question mark.
        >
        > can someone please show me how to do this myself? It'd be appreciated[/color]

        The answer other people seem to have missed is that $_SERVER["PATH_INFO"]
        will be filled with /Main_Page on Apache servers.

        Cheers,


        Andy

        --
        Andy Jeffries MBCS CITP ZCE | gPHPEdit Lead Developer
        http://www.gphpedit.org | PHP editor for Gnome 2
        http://www.andyjeffries.co.uk | Personal site and photos

        Comment

        • Toby Inkster

          #5
          Re: Question on php questionmark variables but slash instead

          Andy Jeffries wrote:
          [color=blue]
          > The answer other people seem to have missed is that $_SERVER["PATH_INFO"]
          > will be filled with /Main_Page on Apache servers.[/color]

          In case there is any doubt, this is the way to go.

          --
          Toby A Inkster BSc (Hons) ARCS
          Contact Me ~ http://tobyinkster.co.uk/contact

          Comment

          • Andy Jeffries

            #6
            Re: Question on php questionmark variables but slash instead

            On Wed, 03 May 2006 09:07:08 +0100, Toby Inkster wrote:[color=blue][color=green]
            >> The answer other people seem to have missed is that
            >> $_SERVER["PATH_INFO"] will be filled with /Main_Page on Apache servers.[/color]
            >
            > In case there is any doubt, this is the way to go.
            >
            > --
            > Toby A Inkster BSc (Hons) ARCS[/color]

            Just out of interest what does ARCS stand for?

            Cheers,


            Andy


            --
            Andy Jeffries MBCS CITP ZCE | gPHPEdit Lead Developer
            http://www.gphpedit.org | PHP editor for Gnome 2
            http://www.andyjeffries.co.uk | Personal site and photos

            Comment

            • Toby Inkster

              #7
              Re: Question on php questionmark variables but slash instead

              Andy Jeffries wrote:
              [color=blue]
              > Just out of interest what does ARCS stand for?[/color]

              Associate of the Royal College of Science.


              --
              Toby A Inkster BSc (Hons) ARCS
              Contact Me ~ http://tobyinkster.co.uk/contact

              Comment

              • Andy Jeffries

                #8
                Re: Question on php questionmark variables but slash instead

                On Sat, 06 May 2006 02:02:21 +0100, Toby Inkster wrote:[color=blue][color=green]
                >> Just out of interest what does ARCS stand for?[/color]
                >
                > Associate of the Royal College of Science.
                > http://en.wikipedia.org/wiki/Royal_College_of_Science[/color]

                OK, thanks mate (and thanks for the link too).

                Just nosey...

                Cheers,


                Andy


                --
                Andy Jeffries MBCS CITP ZCE | gPHPEdit Lead Developer
                http://www.gphpedit.org | PHP editor for Gnome 2
                http://www.andyjeffries.co.uk | Personal site and photos

                Comment

                Working...