help with encoding url params - where do you get it

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
greg_soulsby
Forum Newbie
Posts: 2
Joined: Tue Nov 12, 2002 3:24 pm

help with encoding url params - where do you get it

Post by greg_soulsby »

I have a generic browse function that browses 20 rows at a time. I need to keep the "where" part of the SQL, as entered by the user over may pages. For example where "name LIKE "a%"

I tried coding the valiable with urldecode($browseString) and passing it in the URL. It shows up in the URL as

browseString=%20name%20LIKE%20%22a%25%22

But then I read it in the program it sees

name LIKE \\\"a%

which doesnt urldecode to anything helpful

I cannt find any documentation that is helpful - does anyone know some, or can tell me what to do
LostSoul
Forum Newbie
Posts: 4
Joined: Sun Dec 15, 2002 7:46 pm

Post by LostSoul »

greg_soulsby:
The core of you r problem may just be you aren't adding slashes before encoding the string. Try that and remember to stripslashes before you use it. I'm saying this only if your form is actually sending "name LIKE "a%" also the % after the a may be interpreted by the browser as a special character. Clean up your variables, that may help.
Post Reply