Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2024-08-07 17:48:04

lindabb
Member
Registered: 2023-02-17
Posts: 132

open new page with hidden id

I have list of items as a table, I like to show item’s detail (as new page) when clicked on item name, I know how to do it in normal php ( I have with session to hide the id), but I’m having difficulty to understand it on textpattern, I prefer to hide item id and not showing it for security and abusing the site reason.

Thank you

Offline

#2 2024-08-07 19:49:08

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,425
Website GitHub

Re: open new page with hidden id

Hiding the value will require a session variable and some php. But if you want to obfuscate the information you can do so, but it depends where the information is stored.

If it’s a database table, can you add some kind of reference to each row, made by combining the fields like id+name and then run them through a hash function like sha1(). Then you can output that in your table and look it up in the database on the detail page to locate the actual record.

If they are Textpattern articles in the table, you already have a unique value in each row (uid) so you can use that as a dereferenced variable passed forward to the detail page. You can get that value via <txp:custom_field name="uid" />.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#3 2024-08-09 16:07:27

lindabb
Member
Registered: 2023-02-17
Posts: 132

Re: open new page with hidden id

Thank you

Offline

Board footer

Powered by FluxBB