Home | Products | Consulting | Forums | Support | Order | 1-800-752-0455
  Main
Index
Search
Posts
Who's
Online
Log
In

Home: Products: CMS Builder:
Problem with urlencode

 

 


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:

Code
Chemicals & Dispensers


If I use the urlencoder on your search docs page (http://www.interactivetools.com/docs/cmsbuilder/viewer_search.html) it encodes it like this:

Code
Chemicals%20%26%20Dispensers


If I use php's build in urlencode I get this:

Code
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)

Code
$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.

 
 
 


Search for (options)
Products
CMS Builder
Article Manager
Realty Manager
Listings Manager
Order Now
Services
Priority Consulting
Support
Online Documentation
Support Forums
Support Homepage
Company Info
12 reasons to choose us!
Meet the team
Monthly newsletter
Contact Us
Toll Free: 1-800-752-0455
Phone: (604) 689-3347
Sales | Support
Conditions of Use | Privacy Policy | Copyright © interactivetools.com 2008
#201 - 2730 Commercial Drive, Vancouver BC Canada V5N 5P4