Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

encode a number in URL 1

Status
Not open for further replies.

TheCandyman

Technical User
Sep 9, 2002
761
US
I know this is possible but can't remember how to do it. If i have a page:
Code:
page.asp?i=15
how can i change it to something like
Code:
page.asp?i=(really long text)

I know you can use URLEncode but that only changes special characters, not numbers.

.
 
Do you want the (really long text) to represent 15?

You want to just "mung" it, so people don't realize it's 15?

If you don't want people to see it, why don't you either pass it as a hidden field in a form, or as a session variable?



Just my 2¢
-Cole's Law: Shredded cabbage

--Greg
 
Option 2 plz :)

Easy method #1:

Multiply the number by some insane amount, for example:

15 * 123456789 = 1851851835

page.asp?i=1851851835

... in the receiving page, divide it again.

1851851835 / 123456789 = 15

Easy Method #2:

Convert it to a string, adding random numbers/letters before and after. Only *you* know that the nth characters are your digits. i.e.

AB0CF31B515CF398F357

Easiest method:

Pass it as a session variable:

session("i") = 15



Just my 2¢
-Cole's Law: Shredded cabbage

--Greg
 
i would love to use sessions or hidden inputs in a form but in this case that isn't an option, which is why i'm using variables in the URL.

It's always going to be a number, and i hadn't thought about your way of thinking of x15 then /15. Star for you sir!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top