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....

Recommended Answers

All 2 Replies

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.

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


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

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.