After the ?....

Discussion in 'HTML & Website Design' started by l3l00, May 13, 2013.

  1. #1
    I just want to know if this has a name, I am sure it is a php thing but it sort of falls under this catigory. Say you log into like an email account. It would have:

    www.example.com/mail/whatever/?=..........

    what elements is it pulling to do this?

    I sort of have to do this for my shopping cart when people purchase, I am using a CRM that uses something like {productName}

    So I am trying to make it like (for the css) :

    .../css/theCSS.php?productname={productName}
     
    l3l00, May 13, 2013 IP
  2. GMF

    GMF Well-Known Member

    Messages:
    855
    Likes Received:
    113
    Best Answers:
    19
    Trophy Points:
    145
    #2
    I think this is a GET parameter.

    Taking your example:
    ./css/theCSS.php?productname=productNamn

    You can get the product name via

    $_GET["productname"]

    Some more info
    http://www.tutorialspoint.com/php/php_get_post.htm
    http://php.net/manual/en/reserved.variables.get.php
    
    Code (markup):
     
    GMF, May 14, 2013 IP
  3. WeddiGo

    WeddiGo Greenhorn

    Messages:
    40
    Likes Received:
    2
    Best Answers:
    2
    Trophy Points:
    18
    #3
    it's a GET parameter and you can have quite a few one after the other. It's used a lot to send information from one page to another.
    The first starts with ? and then the rest are delimited with &
    for example: myPage.php?productID=120&price=20&color=blue&title=nice shoes
     
    WeddiGo, May 14, 2013 IP
  4. l3l00

    l3l00 Greenhorn

    Messages:
    58
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #4
    Sorry fellas, the correct answer was a Php query string. . I do know hey does the same but I use POST
     
    l3l00, May 15, 2013 IP
  5. l3l00

    l3l00 Greenhorn

    Messages:
    58
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #5
    http://ditio.net/2008/06/12/php-query-string/

    sorry if that came off as rude.
     
    l3l00, May 15, 2013 IP
  6. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #6
    Uhm... Sorry Charlie, but no it isn't... since it was in the HTTP 1.0 draft specification some four to five years before PHP was a twinkle in Rasmus Lerdorf's eye.

    http://www.w3.org/Protocols/HTTP/Methods.html

    Which was clarified and solidified along with POST in 1.0 final.

    http://www.w3.org/Protocols/HTTP/1.0/spec.html#GET

    Which is why I was using it with PERL before anyone ever even HEARD of PHP.

    While PHP may assign it to a $_SERVER index CALLED "QUERY_STRING", that is not what it or that method of sending data to the server is called. "getData" or "get" is the accurate name for it.

    I was going to rag on that link you posted as the typical misinformation I'd expect from turdpress scale ineptitude, but I think you just mis-read or misinterpreted that article. (which is far less harmful -- that happens)
     
    deathshadow, May 15, 2013 IP
  7. l3l00

    l3l00 Greenhorn

    Messages:
    58
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #7
    ya but the project I am working on was not a form that utilized GET or POST. But Query Strings for php file_get_contents
     
    l3l00, May 15, 2013 IP
  8. l3l00

    l3l00 Greenhorn

    Messages:
    58
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #8
    that and I am using $_REQUEST
     
    l3l00, May 15, 2013 IP
  9. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #9
    Which still uses HTTP requests if it's off site or being served via HTTP... which if you're calling PHP file_get_contents will NOT execute a .php on the same system, it'll just fetch the source code, so you MUST be using HTTP for that, even if PHP is hiding it from you.

    Which is just $_GET, $_POST and $_COOKIE added together. Has nothing to do with it.
     
    deathshadow, May 15, 2013 IP