No,您无法隐藏通过发送的参数<a>
锚标签。
但是,您可以通过加密参数然后在服务器端脚本上解密来混淆参数。
使用加密解密的简单说明...
test1.php
<?php
$key_value = "somekey"; //<--- This is a key for the encryption decryption process
$plain_text = "the secret !"; //<-- The actual text you are going to send.
$encryptedmsg = mcrypt_ecb(MCRYPT_DES, $key_value, $plain_text, MCRYPT_ENCRYPT); //<-- Encrypting...
echo "<a href=test2.php?enc=$encryptedmsg>Click Here</a>"; //<-- Your anchor tag
test2.php
<?php
$key_value = "somekey"; //<--- Note..the same key !
$decryptedmsg = mcrypt_ecb(MCRYPT_DES, $key_value, $_GET['enc'], MCRYPT_DECRYPT); //<-- Decrypting
echo $decryptedmsg; //<-- Prints "the secret"
当点击链接时.. test2.php 将得到enc
参数,然后使用代码对其进行解密,但是,用户将无法读取纯文本。秘密!
这是当您单击来自的链接时它在地址栏上的外观test1.php
...
http://localhost/ext1/test2.php?enc=%D4%1D%96F|C%8B%8C%D7%8AP%19=%13%F6%A1
Warning : The mcrypt_ecb
已弃用。我只是将其用于说明目的,让您了解正在发生的情况。