Custom form submit
I'm trying to figure out how to have a custom form submit. The problem is I have rewritten URLs and need a form to use those "rewritten URLs." So basically, I have input 's' which stands for "search." My form action needs to be this:
I was wondering if it was possible to submit a form and have the value be posted to this URL? Thanks.
It is a little unclear what you are trying to do. But, if I understand correctly, you simply need to set the 'action' attribute in your 'form' tag to:
Have I misunderstood what you are trying to accomplish?
Do you have control over the index.php referenced in your example?
You can interpret the input (GET or POST) and 'reconstruct' the URL, feeding it to a header command as "Location".
$search = $_POST['s'];
header("Location: mysite.com/index.php/search/" . $search);
It's probably easier to sort this within the rewrite rule on your site. If you didn't write these rules yourself google mod rewrite and .htaccess. It's an easy fix and dosen't require bulky JS in the wire.
I'm presuming your using Apache as your server. If anyone knows how to do this in IIS please post too