PHP GET Problem From Form IMAGE <input> field variable... PLEASE HELP!

Discussion in 'PHP' started by Immorta, Feb 9, 2006.

  1. #1
    Hi I have a image on a page of one of my sites which has a large <input type="mage"> image on it.

    When clicked the image goes to a PHP form and I then need to get the x & y values into a PHP form but I cannot get it to work.

    The url looks like this: http://site.ext/page.php?var1=1&coordinate.x=324&coordinate.y=87

    The form that contains the images method="GET" and so I was trying to pull the value of the coordinate using <?php $x = $_GET['coordinate.x']; ?> but that doesnt seem to work, it basically returns no value.

    I have also tried using explode to get the value but it returns nothing, I am guessing it has something to do with the fullstops in the URL.

    If anyone has a solution they can tell me about please do so. If you need any more info than I have listed please ask me for what you need to help.


    Thanks in advance everyone.
     
    Immorta, Feb 9, 2006 IP
  2. Neoto

    Neoto Active Member

    Messages:
    54
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    71
    #2
    Use underscore instead of period. For example:
    <?php $x = $_GET['coordinate_x']; ?>
    PHP:
    That works (at least for me) even if the GET parameter has a period.
     
    Neoto, Feb 9, 2006 IP
  3. Immorta

    Immorta Peon

    Messages:
    379
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Yuh I got that solution as well. PHP apparantly converts the . to an _ which is a bit of a pin in the ass.
     
    Immorta, Feb 9, 2006 IP