473,386 Members | 1,753 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

$_GET[timespace] not working

shoonya
161 100+
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?timestamp_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
Jun 26 '07 #1
3 1219
epots9
1,351 Expert 1GB
what u say it removes the plus sign, i'm going to assume it returns it like this:
Expand|Select|Wrap|Line Numbers
  1. 2007-06-25 21:56:24.37505:30
  2.  
so try this:
[PHP]
$ts=$_GET["timestamp_event"];
$temp1 = substr($ts, 0, count($ts) - 6);
$temp2 = substr($ts, count($ts) - 6);
$ts = $temp1."+".$temp2;
[/PHP]

hope that helps,
good luck
Jun 26 '07 #2
shoonya
161 100+
thanks for the response

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

shoonya
Jun 26 '07 #3
ronnil
134 Expert 100+
if you use urlencode the + sign should be encoded properly with the rest of the string

http://www.php.net/manual/en/function.urlencode.php
Jun 26 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Steve Fitzgerald | last post by:
This should be so easy, but it is not working. What should happen is that if $p=home in the url then it displays home.php and if $p does not equal home then it displays page.php which is a...
7
by: Dan | last post by:
I was trying to troubleshoot a login page that doesn't work - it keeps saying the login/password is missing - when my tracing discovered this peculiar behavior. register_globals is off, so at...
32
by: Nuno Paquete | last post by:
Hi group. I'm using this code to see if is there any parameter for variable "menu": if($_GET == "downloads") .... But this code log errors if there is no parameter passed (this heappens at...
7
by: NotGiven | last post by:
I need to check the $_GET to make certain it is a positive integer. is_integer($_GET) is not working. I think it thinks it's a sting. So I tried casting it to an int using,...
10
by: alanbe | last post by:
I am working on some scripts to help me automate the website creation process. I want to use a template for the whole website and call pages using something like ...
8
by: dude | last post by:
i'll try to be short ... i have this in html : <select name="OS" size="5"> <option value="0" selected>Please select one or more...</option> <option value="1">Windows</option> <option...
0
by: Derek Moore | last post by:
Hi any one help with this one below is the "contact.php form" and the contents of the "button "from with in flash! but all i get back is the field names but no content any ideas??? contact.php...
6
by: daryl | last post by:
Howdy, just wondering if someone can help me get this form working. Everything is right, I think, except for the autoglobal. <body> <h1>Reverse String</h1><hr /> <?php $ReverseString =...
1
by: robin1983 | last post by:
Dear All, I got stuck in simple problem, I have a two php file one for registration form and one for to check and insert into the table. The problem is that when I get any kind error in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.