0

Hi,
This was am using in my code:

echo "<table>";
  echo "<tr><td><b>Please, confirm or reject: </b></td><td><a href='thanks.php'>Confirm</a></td>";
echo "<td><a href='reject.php?name=$name&officerid=$pofficerid&officername=$pofficername&txt1=$ss'>Reject</a></td></tr>";
echo "</table>";

On clicking Reject link, my all values(name,offiderid,officername,txt1) that am passing through hyperlink tag getting visible in the URL.

I don't need the user, to see my passing values in the URL. How can i encoded ? Please help me out thanks....

3
Contributors
2
Replies
4
Views
6 Years
Discussion Span
Last Post by fusedreality
0

You can use base64_encode function to encode text or id.

echo "<a href='reject.php?name=".base64_encode($name)."&officerid=".base64_encode($pofficerid)."&officername=".base64_encode($pofficername)."&txt1=".base64_encode($ss)."'>Reject</a>";

On reject.php you can decode it back.

$name = base64_decode($_GET['name']);

But i advice to pass only one id, and then on reject.php fetch rest data from database using id.

0

You can also do it through a form instead, which will send the values as $_POST data.

e.g.

<form method="post" action="reject.php">
   <input type="hidden" name="officerid" value="<?php echo($pofficerid); ?>" />
   <input type="submit">Reject</input>
</form>

Just add in as many hidden values as you want. These won't show in the URL as long as you use method="post" on the form.

Edited by fusedreality: Making a little clearer.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.