Encode Search links

Post Reply
tubeman
Posts: 534
Joined: Sat Mar 02, 2013 11:33 am

Encode Search links

Post by tubeman »

Hi,
Suppose I have search link on the site like this:

http://xyz.com/search/college babe/

but I want it to be link this,basically encoded

http://xyz.com/search/UGFraXN0YW5pIHh4e ... lvdSB0dWI/

and then furthur on paginated pages:

http://xyz.com/search/UGFraXN0YW5pIHh4e ... WI/best/1/

How do I achieve this?

Regards,
admin
Site Admin
Posts: 37202
Joined: Wed Sep 10, 2008 11:43 am

Re: Encode Search links

Post by admin »

To make things easier let's take a look at this w\o rewrites

So you have a link with ....&group_name=test

if your template you should encode 'test' in anyway you want it to be so it's gonna be

&group_name=<?php echo your_encode_function('test')?>

then you have to pass a regular name to the script , so in common.php you should add

if (isset($_GET['group_name'])) $_GET['group_name'] = your_decode_funciton($_GET['group_name'])
Don't forget to run script update
tubeman
Posts: 534
Joined: Sat Mar 02, 2013 11:33 am

Re: Encode Search links

Post by tubeman »

Hi,
Suppose I want to base64 encode search links then how do I do it? I don't know how to write an encode function, any idea how to do it?
admin
Site Admin
Posts: 37202
Joined: Wed Sep 10, 2008 11:43 am

Re: Encode Search links

Post by admin »

Take a look at base64_encode function in php docs
Don't forget to run script update
Post Reply