 |

johnniefp
User
Aug 14, 2008, 1:06 PM
Post #1 of 3
(497 views)
Shortcut
|
|
Problem with urlencode
|
Can't Post
|
|
Hello. I'm building a menu from a text file which will also be used for a search, the problem I'm having is encoding the string to use as a querystring for the search example string to encode: If I use the urlencoder on your search docs page (http://www.interactivetools.com/docs/cmsbuilder/viewer_search.html) it encodes it like this:
Chemicals%20%26%20Dispensers If I use php's build in urlencode I get this:
Chemicals+%26amp%3B+Dispensers%0A I'd prefer to use php to do this as all I need to update is a text file rather than manaully editing going via the search docs page thanks. Can anyone help with this issue?
|
|
|  |
 |

johnniefp
User
Aug 14, 2008, 1:28 PM
Post #2 of 3
(494 views)
Shortcut
|
|
Re: [johnniefp] Problem with urlencode
[In reply to]
|
Can't Post
|
|
Problem solved. The %0A is an encoded newline character: removed on unix with: (from memory you probably need \n\r on windows and \r on mac)
$cat = str_replace("\n","",$cat); I ended up just using & instead of & which solved the next problem. Also where the urlencode on the search docs page shows %20 (spaces) I have found that + (output from php urlencode() function) also works with the search.
|
|
|  |
 |

Donna
Staff
/ Moderator

Aug 14, 2008, 3:46 PM
Post #3 of 3
(483 views)
Shortcut
|
|
Re: [johnniefp] Problem with urlencode
[In reply to]
|
Can't Post
|
|
Hey, glad to hear you've got that sorted out. Let us know if you run into any problems! Donna
Hire me! Save time by getting our experts to help with your project. Template changes, advanced features, full integration, whatever you need. Whether you need one hour or fifty, get it done fast with Priority Consulting.
|
|
|  |
|