Let’s say the current query string is the following I need a function which can add and remove several parameters from the query string. For example: should give So, not only should the function be able to add new parameters (eyes=2&fingers=10), but it should also change the ones which are already p…
Tag: get
PHP check if array contains any key other than some whitelisted
I would like to check all keys of a global GET array and do something, if it contains keys, other than some whitelisted ones from an array. Let’s say the current url is: Just for better visualization: These GET parameters are all available in the global GET variable which looks something like this: The …
Pre-fill Woocommerce checkout fields with Url variable before session created
I have wordpress site running woocommerce with a few products. I want to send my customer a url to their product which includes their name and email so i can pre-fill name and email on woocommerce …
Storing $_GET and using it again in POST request
I am trying to store $_GET in variables and re-use them in a POST request, but the problem is that as soon as a POST request is sent the URL becomes empty and there is nothing to store in variables or …
How can I redirect to the same page with $_GET parameters in URL
i’ve got a question about redirecting. I put some parameters in my URL so I can use $_GET to get them out en them put them in a variable. Now, when I fill in my form wrong i get redirected but all the parameters are missing and they don’t are in the variables anymore. Is there a way you can
Symfony2 app.php receiving POST request as GET app_dev.php works fine
So I’m creating a route that requires posting. The route is as follows: So I use postman to hit app_dev.php/myroute/login and I get the correct response that I am looking for, currently the page just returns “hello world”. Now when I change postman to just hit app.php/myroute/login I get an …
PHP – hide url (GET) parameters
I have a link in my PHP/HTML like this: When users click on the link, the parameters are handled by a 3rd party website which log the users in seamlessly. Is it possible to hide/mask/camouflage the url so that users don’t see the parameters while still passing them over to the designated site? If no, ho…
rewrite url and let more parameters
I am rewriting this kind of urls http://deia.info/category/calendar/10/ To /index.php?task=browse_posts&catid=$2 By this code in the .htaccess RewriteRule ^category/(.+)/(.+) /index.php?task=…
How to encrypt the $_GET data in php?
As in php we use $_GET to pass variables in the url , i want to pass variables which include the id of the user which i want to be anonymous, so can something be done which can encrypt the variable …
How to check if ID in database exists
Why won’t this send the user to user.php if the ID don’t exist in the table? Answer Try something like this :). http://php.net/manual/en/function.mysql-num-rows.php