I would like a function that will redirect my users to a product.php?id=id (where id is the product id) Ok... So ... the problem is this: this will output ... product1, product2 but if i do something like: then it will only redirect to product.php, everything after the ? will be removed. I tried to put \? but still the same.
I think this is due to the fact that your code will produce the string: product.php?idid Code (markup): This to the browser would mean to send to the server a variable "idid", which doesn't have a value and thus will be discarded. Instead add a "=" sign like this: function remove(id) { window.location="product.php?id="+id; } Code (markup): and everything should work fine.