An Encoding Issue?

fatg

New Member
I think I have a URL encoding issue. I need to open a window using Javascript and pass a SQL Select query to it. So I have done this:\[code\]window.open('view_query.php?sql_query=' + query + '&db_name=' + db_name);\[/code\]This has worked for me, but I have a query that breaks this:\[code\]SELECT a FROM table WHERE field like '%adhoc%' \[/code\]Now when the new window opens and I print the query received from the URL GET variable it looks like this:\[code\]SELECT a FROM table WHERE field like '?hoc%' \[/code\]Notice the bit \[code\]%ad\[/code\] has turned into an unrecognised character! Why?I have tried solving this with URL encoding but since I need the \[code\]%\[/code\] symbol I can't use many URL encoders since they will turn this into something else?!Thanks all for any help.
 
Back
Top