[FX.php List] Encoding a link so that it'll process...

Bob Patin bob at patin.com
Thu Jul 14 17:49:50 MDT 2016


To explain what I'm trying to do:

My client says that, in the old site,users often grabbed the URL from the address bar, so that they could get back to a search they did.

So, I was trying to generate a link that they can grab, and then pass it into my jQuery site, and duplicate the search results.

So long as the search params are single-words, my link works great, but if I do a SEARCH and select something with 2 words, the link that I'm generating won't work.

I just don't get it... :)

> On Jul 14, 2016, at 6:42 PM, Bob Patin <bob at patin.com> wrote:
> 
> I did... 
> 
> Here's a link that works:
> 
> http://tirms.longtermsolutions.com/?ql=true&cc=Acadian <http://tirms.longtermsolutions.com/?ql=true&cc=Acadian>
> 
> but if I add the 2nd word in their name
> 
> http://tirms.longtermsolutions.com/?ql=true&cc=Acadian <http://tirms.longtermsolutions.com/?ql=true&cc=Acadian> AgriTech
> 
> it fails. The funny thing is though, I use jQuery and pass that 2-word name in the original query and it works.
> 
> I also tried
> 
> http://tirms.longtermsolutions.com/?ql=true&cc=Acadian%20AgriTech <http://tirms.longtermsolutions.com/?ql=true&cc=Acadian%20AgriTech>
> 
> but that fails too...
> 
> The question i have is, WHAT can I put between the 2 words that will get passed to my query and work?
> 
> Thanks for your help,
> 
> Bob
> 
> Bob Patin
> Longterm Solutions
> bob at longtermsolutions.com <mailto:bob at longtermsolutions.com>
> 615-333-6858
> FileMaker 9, 10, 11, 12 & 13 Certified Developer
> http://www.longtermsolutions.com <http://www.longtermsolutions.com/>
> -
> iChat: bobpatin at me.com <mailto:bobpatin at me.com>
> Twitter: bobpatin
>> FileMaker Consulting 
> FileMaker Hosting for all versions of FileMaker
> PHP • Full email services • Free DNS hosting • Colocation • Consulting
> 
>> On Jul 14, 2016, at 6:34 PM, Tim 'Webko' Booth <tim.webko at gmail.com <mailto:tim.webko at gmail.com>> wrote:
>> 
>> Have you tried a + instead of %20 ? 
>> 
>> On 15 July 2016 at 09:14, Bob Patin <bob at patin.com <mailto:bob at patin.com>> wrote:
>> I'm generating a link on a PHP page, like this:
>> 
>> http://www.site.com/test.php?cc=two <http://www.site.com/test.php?cc=two> words
>> 
>> The client wants to be able to copy this link for use later, but when we do so, anytime "cc" is 2 or more words the query fails.
>> 
>> I tried encoding the spaces like this
>> 
>> two%20words
>> 
>> but it still didn't work.
>> 
>> Then I tried doing a str_replace to get something like this:
>> 
>> two|words
>> 
>> and then when the user gets to the page, taking the pipe and putting a space back in before the search. That failed too...
>> 
>> Any thoughts?
>> 
>> 
>> Bob Patin
>> Longterm Solutions
>> bob at longtermsolutions.com <mailto:bob at longtermsolutions.com>
>> 615-333-6858 <tel:615-333-6858>
>> FileMaker 9, 10, 11, 12 & 13 Certified Developer
>> http://www.longtermsolutions.com <http://www.longtermsolutions.com/>
>> -
>> iChat: bobpatin at me.com <mailto:bobpatin at me.com>
>> Twitter: bobpatin
>>>> FileMaker Consulting
>> FileMaker Hosting for all versions of FileMaker
>> PHP • Full email services • Free DNS hosting • Colocation • Consulting
>> 
>> _______________________________________________
>> FX.php_List mailing list
>> FX.php_List at mail.iviking.org <mailto:FX.php_List at mail.iviking.org>
>> http://www.iviking.org/mailman/listinfo/fx.php_list <http://www.iviking.org/mailman/listinfo/fx.php_list>
>> 
>> _______________________________________________
>> FX.php_List mailing list
>> FX.php_List at mail.iviking.org <mailto:FX.php_List at mail.iviking.org>
>> http://www.iviking.org/mailman/listinfo/fx.php_list
> 
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.iviking.org/pipermail/fx.php_list/attachments/20160714/ae3fcda3/attachment-0001.html


More information about the FX.php_List mailing list