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!

 

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.

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!

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.