%40 converted into @ on Get
Asked Answered
M

2

6

I am passing my variables as follows to url using GET method

http://www.mysite.com/demo.php?sid=123121&email_id=stevemartin144%40gmail.com

& when i print $_GET on demo.php it displays parameters as follows:

email_id    [email protected]
sid 123121

instead of above output i want parameters as i passed

email_id    stevemartin144%40gmail.com
sid 123121

I don't want to convert %40 into @

please suggest me solution on this

Thanks in advance

Mavis answered 25/6, 2013 at 13:0 Comment(0)
H
6

"%40" in a URL means "@". If you want a "%" to mean "%", you need to URL encode it to "%25".

URL encoding is just a transport encoding. If you feed in "@", its transport encoded version is "%40", but the recipient will get "@" again. If you want to feed in "%40" and have the recipient receive "%40", you need to URL encode it to "%2540".

If the recipient correctly receives "@" but you want to use the URL encoded version for whatever reason, you can also have the recipient urlencode it again.

Hornwort answered 25/6, 2013 at 13:4 Comment(0)
U
0

Notes:

Online Converter:

Replace special characters with its equivalent hexadecimal unicode. For a list of unicodes refer the website https://unicode-table.com (or) http://unicodelookup.com

Local Converter using Python:

Reference: conversion of password "p@s#w:E" to unicode will be as follows,

@ = %40
$ = %24
# = %23
: = %3A
p@s#w:E = p%40s%23w%3AE

Input:

[root@localhost ~]# python -c "import sys, urllib as enc; print enc.quote_plus(sys.argv[1])" "p@s#w:E"

Output:

p%40s%23w%3AE
Underfeed answered 15/7, 2018 at 8:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.