I have a link on a page, and I would like to send a variable to a php file like this:
href = "php_file.php?qry=$query"
the $query variable contains a query which I would like to make to mysql, inside the php file.
My problem is, I don’t want the users to ‘see’ what I am passing along. I would like to use $_POST but from what I know, that isn’t possible.
Is there any other simple way?
Thanks
That is not possible. Even if you used POST it would be very insecure.
My suggestion would be to put the query in the $_SESSION variable and reference it back in php_file.php If you have multiple queries you could give them some kind of IDs and store the id=>query pair in session.
Quick example:
Obviously this is very simplistic and you might want to add some more “security” to it (check for empty parameters etc.) but at least your query wouldn’t be visible to the user.