Jump to content

Dropdown, passing selected values in a formate so it matches URL_Redirect Patter


natasha_thomas

Recommended Posts

Folks,

 

I have a dropdown, once values are selcted, these values should be put in a URL structure so that it matches with the one MoD_rewrite rule in my .htaccess.

 

Here is my Mod_Rewrite Rule:

 

   RewriteRule ^(.*)/([^/]*)\.html$ search.php?q=$1&sc=$2 [QSA,L] 

 

 

Here is my Dropdown Code:

 

	 <div id="search" >

<form id="searchform" method="get" action="search.php">
<label>Search By Brand/ Manufacturer: </label>


<select name="q">

<option value="SelectBrand">Select Brand</option>

<?php if(isset($this->search->options)): ?>
<?php foreach($mfg as $lolachild): ?>

  <option value="<?php echo $lolachild; ?>"><?php echo ucwords($lolachild); ?></option>

<?php endforeach; ?>
<?php endif; ?>
</select>





<select name="sc">
  <option value="All"><?php eprint(LangAll); ?></option>
<?php if(isset($this->search->options)): ?>
<?php foreach($this->search->options as $cat): ?>
  <option value="<?php echo $cat->value; ?>"><?php echo $cat->name; ?></option>
<?php endforeach; ?>
<?php endif; ?>
</select>

        <input type="submit" value="<?php eprint(LangSearch); ?>" />

</form>
 </div> 

 

 

Problem is, upon Submit, it goes to this link structure:

 

http://mydomain.co.uk/search.php?q=fisher&sc=302

 

It should rather be:

 

http://au2.co.uk/fisher/302.html

 

What am i missing or doing wrong?

 

Cheer

Natasha

 

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.