Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Jan 2014
    Posts
    74
    Thanks
    11
    Thanked 0 Times in 0 Posts

    Escaping decimals in a URL variable

    Does anyone know how I can escape a decimal in a URL variable?

    I.E: example.com/?value=100.00

    echo $_GET['value']; returns '', when I am wanting it to return '100.00'.

    I tried using quotes around 100.00 in the URL, but it didn't work.

  2. #2
    Master Coder sunfighter's Avatar
    Join Date
    Jan 2011
    Location
    Washington
    Posts
    6,287
    Thanks
    30
    Thanked 863 Times in 861 Posts
    <?php
    header('Location: test.php/?value=100.00');
    ?>

    You are sending to example.com it should be to a php file.
    Evolution - The non-random survival of random variants.
    Physics is actually atoms trying to understand themselves.

  3. #3
    Regular Coder
    Join Date
    Oct 2004
    Posts
    377
    Thanks
    0
    Thanked 26 Times in 26 Posts
    You do not need to escape decimals. What does print_r($_GET); output?

    You are sending to example.com it should be to a php file.
    It could be an index.php file.

  4. #4
    New Coder
    Join Date
    Jan 2014
    Posts
    74
    Thanks
    11
    Thanked 0 Times in 0 Posts
    My PHP is configured to parse PHP in .html files.

  5. #5
    Senior Coder
    Join Date
    Aug 2006
    Posts
    1,862
    Thanks
    12
    Thanked 399 Times in 396 Posts
    This is one weird thread...

    Do the print_r($_GET); that schleppel suggested, and let us know what it outputs.


 

Posting Permissions

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