Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End what’s the difference between those links

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #32913
    The-Marshal
    Member

    Hi all

    what i know is


    mydomain/index.php?id=1 ....

    but this really i first time see it


    http://mydomain/index.php?img=http://mydomain/images/1.png

    also this


    http://mydomain/?7

    could you explane the difference ?

    #74985
    jamygolden
    Member

    You can store variables within the URL. for example:

    http://mydomain.com/?name=Jamy&favfood=Pankcakes

    That would load mydomain.com with the variables of name = Jamy and favfood = Pancakes.

    You could fill out a form, click submit and the next page could be loaded with info you typed stored in the URL. It could then greet you. “Hi Jamy”, etc.

    This is done via PHP’s $_GET. Have a look at this: http://php.net/manual/en/reserved.variables.get.php

    #74951
    ddliu
    Member

    http://mydomain/index.php?img=http://mydomain/images/1.png

    it’s no difference with


    mydomain/index.php?id=1

    they are all key-value pairs, you can retrieve the first one with $_GET or $_REQUEST on server side; you can retrieve the second one with $_GET or $_REQUEST on server side.

    For the last one:


    http://mydomain/?7

    It’s useful for a user friendly url(which may be replaced by url rewrite for a more friendly url), you can get the request data with $_SERVER on server side – that is $_SERVER=7 in your given url.

    #74941
    The-Marshal
    Member

    I understand now thank you very much jamy and ddliu ..

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘Back End’ is closed to new topics and replies.