PHP Web Host - Quality Web Hosting For All PHP Applications Just Great Software
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
hinksta
Worker
Worker


Joined: Dec 23, 2005
Posts: 226
Location: UK

PostPosted: Thu Nov 30, 2006 7:37 am Reply with quote Back to top

I'm trying to GT a database search module i've made but having problems with the GT'd serch results when it has multipule search words.

modules.php\?name=MySearch&search=([a-zA-Z]*)&page=([0-9]*)
football_news_\\1_page-\\2.html

The first parameter is the search words and works fine with one word but if I have more than one search word I get

football_news.html&search=WORD1%20WORD2&page=2

the original url looks like search=WORD1 WORD2 so I think it's the space but can't figure it out.
View user's profile Send private message Visit poster's website
hinksta
Worker
Worker


Joined: Dec 23, 2005
Posts: 226
Location: UK

PostPosted: Thu Nov 30, 2006 7:50 pm Reply with quote Back to top

If I put a space after the Z

modules.php\?name=MySearch&search=([a-zA-Z0-9 ]*)&page=([0-9]*)

I get

football_news_WORD1%20WORD2_page-2.html

Is there a way to replace the %20 with a space?


Last edited by hinksta on Fri Dec 01, 2006 5:36 am; edited 1 time in total
View user's profile Send private message Visit poster's website
evaders99
Moderator


Joined: Apr 30, 2004
Posts: 2853

PostPosted: Thu Nov 30, 2006 11:19 pm Reply with quote Back to top

%20 is a space character. Are you saying its not working as a space?
View user's profile Send private message Visit poster's website
hinksta
Worker
Worker


Joined: Dec 23, 2005
Posts: 226
Location: UK

PostPosted: Fri Dec 01, 2006 5:34 am Reply with quote Back to top

evaders99 wrote:
%20 is a space character. Are you saying its not working as a space?


Yes, maybe I'm not writing the htaccess corectly

RewriteRule ^football_news_([a-zA-Z0-9]*)_page-([0-9]*).html modules.php?name=MySearch&search=$1&page=$2 [L]

I saw in a post by Audioslaved that you should use % , something like ([a-zA-Z0-9%]*) to sort the space but that's not making any difference.
View user's profile Send private message Visit poster's website
hinksta
Worker
Worker


Joined: Dec 23, 2005
Posts: 226
Location: UK

PostPosted: Fri Dec 01, 2006 7:27 pm Reply with quote Back to top

fixed it with $search = str_replace(" ", "-", $search);
View user's profile Send private message Visit poster's website
montego
Site Admin


Joined: Aug 29, 2004
Posts: 7487
Location: Arizona

PostPosted: Sat Dec 02, 2006 10:20 am Reply with quote Back to top

I would try using the exact same regex that you used in the GT file. Did the following really not work?:

RewriteRule ^football_news_([a-zA-Z0-9 ]*)_page-([0-9]*).html modules.php?name=MySearch&search=$1&page=$2 [L]

Notice the space after the 9.
View user's profile Send private message Visit poster's website
hinksta
Worker
Worker


Joined: Dec 23, 2005
Posts: 226
Location: UK

PostPosted: Sat Dec 02, 2006 10:39 am Reply with quote Back to top

No it would not work, but the fix works well, had to do the oposite fix for the $keywords so that pagelinks would work.

It's a cool little module that searches the multiheadlines database allowing me to make perminent gt'd links with dynamic titles using search terms.
View user's profile Send private message Visit poster's website
montego
Site Admin


Joined: Aug 29, 2004
Posts: 7487
Location: Arizona

PostPosted: Sat Dec 02, 2006 10:46 am Reply with quote Back to top

that is strange. I could have sworn that I've seen this working (not with your specific module, but the concept). If I get time, I'll check this on one of my sites.
View user's profile Send private message Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2008 by Raven
Proud to be listed at Lobo Links Web Directory

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::

:: fisubice Theme Recoded To 100% W3C CSS & HTML 4.01 Transitional Compliance by Raven and 64bitguy ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum