$_GET[timespace] not working

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • shoonya
    New Member
    • May 2007
    • 160

    $_GET[timespace] not working

    i have got a time stamp

    [PHP]$ts = "2007-06-25 21:56:24.375+05 :30";[/PHP]
    which i am semding to php

    [PHP]echo "<a href='../php/delete.php?time stamp_event=$ts ' >Delete</a>";[/PHP]

    now on php page using $_GET[timestamp_event] , removes the '+' sign
    and thus it's not getting matched with the db entry

    any quick solution
    i have tried addslashes ans preg_quote but i can't make it out

    [PHP]echo preg_quote($ts) ;
    // gives
    // 2007-06-25 21\:56\:24\.375 \+05\:30[/PHP]

    shoonya
  • epots9
    Recognized Expert Top Contributor
    • May 2007
    • 1352

    #2
    what u say it removes the plus sign, i'm going to assume it returns it like this:
    Code:
    2007-06-25 21:56:24.37505:30
    so try this:
    [PHP]
    $ts=$_GET["timestamp_even t"];
    $temp1 = substr($ts, 0, count($ts) - 6);
    $temp2 = substr($ts, count($ts) - 6);
    $ts = $temp1."+".$tem p2;
    [/PHP]

    hope that helps,
    good luck

    Comment

    • shoonya
      New Member
      • May 2007
      • 160

      #3
      thanks for the response

      this is one of the solution
      but is there any better way to escape the '+' sign in the url ??

      shoonya

      Comment

      • ronnil
        Recognized Expert New Member
        • Jun 2007
        • 134

        #4
        if you use urlencode the + sign should be encoded properly with the rest of the string

        Comment

        Working...