What are the potential issues when passing data through URLs in PHP?
One potential issue when passing data through URLs in PHP is the security risk of exposing sensitive information. To solve this issue, it is recommended to use encryption or hashing techniques to protect the data being passed through the URL.
// Encrypt the data before passing it through the URL
$data = "sensitive_data";
$encrypted_data = openssl_encrypt($data, 'AES-128-CBC', 'secret_key', 0, 'random_iv');
$url = "http://example.com/page.php?data=" . urlencode($encrypted_data);
header("Location: $url");
exit;