Encrypt string when passing it through url as hyperlink and decrypt to echo out on next page?

Hi please help,
actually i am passing two parameter through url as hyperlink and store in two variable through get method.
like :

echo ‘< a href=view.php?id=’.$obj->id .‘&’.‘Product_name=’.$obj->product_name.‘>View Details< /a>’

but i want to secure my id and product name. So please suggest what can i have to do.

secure in what sense?

if you intend to cryptographically encode it, that only shoots you in the foot. product id/name are neither sensitive data (otherwise you wouldn’t put them to display) nor do they trigger an modifying action. and a good part of your PHP scripts will need to work with (at least) the product id, so it should be easily accessible (not to mention that you couldn’t do something with it on the server level where PHP is not yet invoked).

I think you would be better to do it in a form if you want it securely transmitted.

for example

<form id="store" action="view.php" method="post">
  <label>View Product Info</label>
  <input type="hidden" name="id" value="<?php echo $obj->id; ?>">
  <input type="hidden" name="post" value="<?php echo $obj->product_name; ?>">
  <input type="submit" name="submit" value="submit">
</form>

though it still could be looked by viewing the html source if you want to be really secure so it can’t be viewed at all then another method is going to be needed, then someone else might know of something. Though I can’t what harm viewing the product name or id would do?

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.