Decrypt, Encrypt
<p>This is what I'm trying to do :</p>

<p>I have a CMS website, in my admin panel i can add some packages users can buy from my website. So in my Choose.php page, users can select which package the want to buy. And of course the price is set for each package not by them, but by me. </p>

<p>If they click on a package, the page sends the data to another page like this :</p>

<pre><code>$form  = '&lt;form action="/buy.php?'product_name='.$name.'&amp;product_id='.$product_id.'&amp;price='.$ammount.'" method="post" target="_parent" &gt;&lt;input type="submit"     style="background-image:url(images/p.png);height: 55px;width: 118px;" value=""/&gt;&lt;/form&gt;';
</code></pre>

<p>So users only click on predefined packages. If a user is some how expert in PHP, or even in scripting, he can easily change the url like :</p>

<blockquote>
  <p>product_name=MYPRODUCT&amp;product_id=1&amp;price=1000$</p>
</blockquote>

<p>to something like this :</p>

<blockquote>
  <p>product_name=MYPRODUCT&amp;product_id=1&amp;price=10$</p>
</blockquote>

<p>this means, they can buy the same package for 10&amp; instead of 1000$.</p>

<p>So i need to ecrypt this url which is gernerated for each package separately, to something like this :</p>

<pre><code>$form  = '&lt;form action="/buy.php?MVNnaPgxpQizqwv7YElroi5E" method="post" target="_parent" &gt;&lt;input type="submit"     style="background-image:url(images/p.png);height: 55px;width: 118px;" value=""/&gt;&lt;/form&gt;';
</code></pre>

<p>then in my Buy.php page, this encrypted string, deycrypts.</p>

<p>But the problem is with the decryption part, because when I deycrypt it, it says it's an Array ( because i use $_GET to get the url ).</p>

<p>And when I use array deycription methods, i get an error in my first page, which it says the value i'm encrypting is a String not an Array. ( Remember : product_name=MYPRODUCT&amp;product_id=1&amp;price=1000$           which is a string. )</p>

<p>So how can i encrypt a string in one page, send it through url ( with $_POST ) then in the Buy.php page, use the $_GET and deycrypt it to arrays.</p>

<p>Sorry if it becomes a long post. And I need an encryption/decryption code.</p>
