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

 

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.