Affiliate Marketing
Forum Search

Reply
 
LinkBack Thread Tools Display Modes

  #1 (permalink)  
Old 24-09-06
1BIZLIST's Avatar
In need of a mentor!
 
Join Date: Mar 2006
Posts: 297
Thanks: 0
Thanked 0 Times in 0 Posts
1BIZLIST is an unknown quantity at this point
  Help with form submission

Hi all,

I have implemented mod_rewrite on my site which has a search facility, the thing is when the form is submitted I get the following URL format search.php?search=xxx&submit=go , I have tried and tried to get the result to be /search/xxx/ when the form is submitted, does anyone know a way of doing this?

All the mod_rewrite stuff is working really well and I know /search/xxx/ works as well, as links within the site created like that work just fine, so it is purely the output from submitting the form I need sorted now.

TIA
Mark.

p.s if your site was w3c compliant would you bother to display the logo ?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 24-09-06
Registered User
 
Join Date: Mar 2004
Location: Reading, UK
Posts: 301
Thanks: 0
Thanked 0 Times in 0 Posts
dmorison is an unknown quantity at this point
Hi Mark,

Browsers only know how to do a GET in the normal way (unless you want to go with JavaScript); so the safest way to do this would be to issue a redirect at the top of your search script. If you're using PHP, you could do it something like this:

PHP Code:
if ($_GET["submit"]=="go")
{
  
header("Location: /search/".$_GET["search"]."/");
  exit();

Other scripting languages will have a similar mechanism for doing the same thing, but that's the general idea.

If you're happy to rely on JavaScript, the following should work (not tested tho'!):

Code:
<script type='text/javascript'>
  function mySubmit()
  {
    window.location = "/search/" + document.myForm.search.value + "/";
  }
</script>
<form name='myForm' action='javascript:mySubmit()'>
  <input type='text' id='search' /> 
  <input type='submit' value='Go' />
</form>
Quote:
p.s if your site was w3c compliant would you bother to display the logo ?
Personally I don't bother; as my sites only seem to remain w3c compliant for a few minutes after going through a phase of making my sites w3c compliant

Hope this helps!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 24-09-06
Registered User
 
Join Date: Jul 2005
Location: North Devon
Posts: 664
Thanks: 0
Thanked 2 Times in 2 Posts
futureweb is an unknown quantity at this point
I think you would have to make your form post rather than get and use some kind of jump script to fire off to the new url like:

PHP Code:
<?
if(isset($_POST['submit'])){
// May be some checks here is search empty special chars etc..
$search urlencode($_POST['search']);
header("Location: /search/".$search."/");
}
?>
<form name="search" action="" method="post">
<input type="text" name="search" value="Search for?" />
<input type="submit" value="go" name="submit" />
</form>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 24-09-06
1BIZLIST's Avatar
In need of a mentor!
 
Join Date: Mar 2006
Posts: 297
Thanks: 0
Thanked 0 Times in 0 Posts
1BIZLIST is an unknown quantity at this point
Awesome,

I think basically both replies were heading in the same direction, and it works a treat!

Many Thanks
Mark.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
My Keyword Research - Care to contribute to the research? webdesignhq Search Engine Strategies 4 26-03-07 09:52 AM
Form spam problem mibut Widgets, Coding, AJAX, PHP - Technology & Affiliate Marketing 16 07-02-07 02:22 AM
Form spammers - what to do! smn2 The Affiliate Marketing Lounge 4 12-09-06 02:42 PM
Lost password form on CJ website woutermols Commission Junction - CJ UK 0 30-03-05 06:18 PM
ARELIS 3 Link Popularity Software Qui Gon Jinn Website Promotion 4 05-03-03 07:34 AM


Affiliate Marketing RSS Feeds - Contact Us - Affiliate Marketing - Archive - Privacy Statement - Top

Content Relevant URLs by vBSEO 3.2.0 RC7