Home > Mobile >  How to make secure data transfer using PHP GET method
How to make secure data transfer using PHP GET method

Time:11-09

In my application I have used GET method to send data over URL in many places. I think it is a not secure way to send data over the URL. Just the data are showing in URL.

Ex:

<a href="check_appointments.php?user=<?php echo $_GET['userid'] ?>&p_id=<?php echo $_GET['pid'] ?>">  </a>

I want to transfer data in secure way. Is there any way to hide these information or any encryption method to follow. Please someone help me to improve my codes. Any help may highly appreciated.

CodePudding user response:

You can encode your data by base64_encode method. It will be encrypted when sending via url. base64_decode to see the decrypted data.

<a href="check_appointments.php?user=<?php echo base64_encode($_GET['userid']) ?>&p_id=<?php echo base64_encode($_GET['pid']) ?>">  </a>

CodePudding user response:

use base64 encode is not the best way to send sensible data, this encoded data can be decoded with online decoders such as https://www.base64decode.org/, you must to use https protocol on your server to transfer sensible data and use a method like base64 encode just to "hide it".

  • Related