Jump to content

[SOLVED] form field...How do I get this URL after searching?


nicob

Recommended Posts

With this code I get http://www.mydomain.com/search/page.php?q=blabla+blabla

<form method="get" action="search/page.php">
<fieldset>
<input type="text" name="q" value="" />
<input type="submit" value="search" />
</fieldset>

 

Now I want this result => http://www.mydomain.com/search/-blabla+blabla-1-1-10-and.html or http://www.mydomain.com/search/-blabla-1-1-10-and.html but I don't know how!

 

Link to comment
Share on other sites

you could post the "search" to a page where it is then processed like that. Example:

<?php
if($_GET['q'] > ''){
   $stuff = "-1-1-10-and";
   header('location: search/'.$_GET['q'].$stuff.'.html'); die();
} else {
   echo "you did not enter anything for the search";
}

this being said, I'm not sure what your doing with this or even how this will work once you have achieved what you asked in this thread.

Link to comment
Share on other sites

Thank you for the code, Brian. But I was looking for a manipulation from the search form.

 

I'm not sure what your doing with this

By using 'RewriteRule' in htaccess I can visit a search result in this way => http://www.mydomain.com/search/-blabla+blabla-1-1-10-and.html . But when I use the search field I get the old url => http://www.mydomain.com/search/page.php?q=blabla+blabla and I don't want this to show for the users anymore!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.