I can not pass the value of a variable from page request.php to page response.php that contains a MD5 encrypted value stored in a field in the mysql database for deleting a record.
Request.php page:
- Through query I extract the value stored in MD5: cod_idcrypt.
- The value of the field cod_idcrypt is recovered and set in the link:
<a href="response.php?crypt=<?php echo $cod_idcrypt; ?>"
onclick="return confirm('Vuoi eliminare il valore?');">Cancella record</a>
Response.php page:
include("connect.php");
$cod_idcrypt =$_REQUEST['crypt'];
$sql="DELETE FROM tbl_product WHERE cod_idcrypt=".$cod_idcrypt;
$result=mysql_query($sql);
The records identified by cod_idcrypt is written correctly because I verified that the id primary key cod_id, is equal to the value written in cod_idcrypt function MD5.
select md5(123) as cod_id, '202cb962ac59075b964b07152d234b70' from dual;
Checks that I made: a) The delete function properly if made on db with the encrypted value b) The problem described above does not arise if you use the primary key instead of the id encrypted
I would use the encrypted value to avoid showing the url id real.
How can I fix?
Thank you