The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
securing url id's
#3
(10-10-2018, 09:53 PM)eforbes Wrote: I am really concerned about showing url id's to view details for a product that i am setting up.  Is there a way in US to hide or make it more secure?

This is what i have:  
Code:
<a href="product_details.php?transac_id=<?php echo $product['id']?>">Product Name</a>

You could maintain a session table perhaps? Generate a nonce which maps to the product ID, store it in the database or the php session (edit: or both, probably; you want the nonce in $_SESSION or a cookie, and the mapping in a database table). Your link would then be
Code:
<a href="product_details.php?transac_id=<?php echo $nonce?>">Product Name</a>

Your product_details.php page can then look up the nonce in the session or db to retrieve the product ID. Just generate hashes or random strings for the nonce, and there'll be no way to reverse engineer or expose the product IDs. Think about likely hash collisions if you're doing it yourself.
I'm at a bit of a loss as to _why_ you'd want to do that, but hey, it's probably doable Smile
  Reply


Messages In This Thread
securing url id's - by eforbes - 10-10-2018, 09:53 PM
RE: securing url id's - by Brandin - 10-13-2018, 03:51 PM
RE: securing url id's - by jtullett - 10-13-2018, 07:21 PM
RE: securing url id's - by Brandin - 10-14-2018, 05:47 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)