Jump to content

Recommended Posts

I've been using an option that's a state, an example would be South Carolina or North Dekota.

In the url the $_GET var turns it into South+Carolina or North+Dekota.

Is this common and okay across different Browsers? I've tried ie and firefox and the + sign is addded but I was wondering if they're just designed to be as idiot proof as possible.

 

Thanks

well, to my knowledge, most if not all modern browsers will automatically encode the data to be passed in the url. However if you want to be sure that it will, you can simply encode the data yourself.

... if you want to be sure that it will, you can simply encode the data yourself.

 

Thanks Aykay.., I tried using str_replace last night change the space to a plus sign and it put something like South%2BCarolina (I think that's what it was more or less) in the url.

 

I think i'll just put a dash instead of a plus sign in the spaces of the variables that need them then remove the dashes for the db query.

 

I'll mark this closed in a couple of hours if no one else chimes in.

 

Thanks again.

S

... if you want to be sure that it will, you can simply encode the data yourself.

 

Thanks Aykay.., I tried using str_replace last night change the space to a plus sign and it put something like South%2BCarolina (I think that's what it was more or less) in the url.

 

I think i'll just put a dash instead of a plus sign in the spaces of the variables that need them then remove the dashes for the db query.

 

I'll mark this closed in a couple of hours if no one else chimes in.

 

Thanks again.

S

it put a %2B in the url because that is the encoded value of +.

as I said, you can either encode this yourself to be absolutely sure, or you can simply divide the words by a url-friendly character, which you have done.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.