I’m new to PHP, I started about 3 weeks ago.
I have a string, which is used with $_POST to pass it to another page, the second page uses $_GET to get these url and split it as desired.
My problem is that, in my first page I use a String, and I want to encrypt it, so that I can pass it as a plan text. In the second page I must decrypt it and get it as an array.
So is there any encryption method or function I can use which is compatible with $_POST ( so I can send it to another page ) and decrypt it as an array ?
I need this method, because the second page is actually connecting to website and is a payment method. So i don’t want users to manually edit the url and lower the amount of $ for the product they get.
tnx for your help.
What you probably want to do is pass the contents of the users cart (i.e. the items he’d like to order) to the payment site.
Therefore, you should create a form like:
On the server in the file “URL/to/paymentPage.php” you can access the items using the following code:
where the function getPriceFromDB actually retrieves the price for the item/product with the id $itemID from your database or elsewhere… 🙂
However, the user items are usually stored in the session, and, therefore, there is no need to submit the again.. 😉