url and database safe instance id?

Home Forum Integrating PerfectForms url and database safe instance id?

This topic contains 1 reply, has 0 voices, and was last updated by  Anonymous 9 years, 7 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #970


    I’m using the instance id as a unique identifier in a url. I write the instance id to a database, then when it’s in the url string, I an do a query and get the record associated with that instance id. The problem is that instance Id’s have characters that are causing problems with the url and with the database query (=, /, [space], etc.). I know I can use URLEncode, but that’s still causing problems with the database storage. I like the fact that the instance id is long and not easily guessable. I’ve tried Replace, but I would have to do it multiple times and I’d have to know every character that might show up in the instance id that I would have to replace. What’s the best way to clean up the instance ID so it only contains the same characters you would find in, say, a UUID?



    I used a regex (hadn’t known that would work) in my Pattern field for Replace. This is the one: [^a-zA-Z0-9s]. Seems to do what I need it to do.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

© Copyright 2021. All rights reserved.
Contact Us