0

i want to pass value from php page to another using url, values are encrypted using md5,so I get in url http://localhost/1.php?id=8f14e45fceea167a5a36dedd4bea2543 that's what i want but in my second page and when i use $_GET["id"] I can't see the value,just md5 value,so there are any function to decrypt this md5 value? Thank you.

1Page :

<script type="text/javascript">
function fn(a)
{  
   var table = document.getElementsByTagName("table")[0];
   //var secondRow = table.rows[a];
   //alert(secondRow.id ); 
    var res=table.rows[a].cells[0].innerHTML;
    alert(res);  
}
</script>
<table class="table " id="tableId">
    <?php 

$i=0;
while ( $i<= 10) {  
echo "
    <tr onclick=\"location.href='2.php?id=".md5($i)."'\">
    <input type='hidden' name='cid' value='11' />
    <td>$i</td>                          
  </a></tr>";
$i++;
}
 ?>
</table>
</body>

2Page :

<?php 

print_r($_GET["id"]) ; //result :8f14e45fceea167a5a36dedd4bea2543 

?>
John_P
  • 103
  • 6
  • 5
    md5 is not encryption, it's a one-way hash and cannot be reverse.... and trying to reverse a hash is like trying to get a cow from a beefburger – Mark Baker Dec 30 '15 at 02:28

1 Answers1

0

MD5 hashes are one way, they cant be decrypted. If they could be decrypted, the world would save billions of dollars in storage space as we could fit an infinite string into 32 characters / bytes. Without going into too much detail, it's like adding 1+4+5+1+2+3+.... and getting a single number of 16. Unless we know the original values, we cant actually determine how many numbers were added up to make 16 or what the original numbers where.

Hope this helps in your understanding of hashing.

Matt
  • 2,851
  • 1
  • 13
  • 27