PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I am using a timestamp to uniquely identy shopping cart. Here is the output of one such cartID :
2008-02-07 20:43:49
I am passing the value as a query string and in the url you can see just the first part of the value (that is the date) appears. How can i pass the whole value as query string.
urlencode() is not adding the single quotes (?cart='2008-02-08+00%3A40%3A34') so where are you adding them into the URL string?
If you can't figure that out, you can do trim($_GET['cart'], "'"). That also shows that you should be doing validation and filtering of these request variables for security reasons. SQL injection would be very easy with your code.
It would likely be much easier and more secure to add an ID field to your database table. Then, use that field to request and pull records. It also makes validation and protection against SQL-inj much easier, because you can just cast it to an int before you use it.