voyde Posted February 29, 2008 Share Posted February 29, 2008 On a form submit the out put is.... site.com/?s=bananas&q=coconuts&p=1 how to get it on submit to.... site.com/bananas/coconuts/1 ? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/93635-mod-rewrite-forms/ Share on other sites More sharing options...
blackwinter Posted March 6, 2008 Share Posted March 6, 2008 For this it is actually quite simplistic .htaccess RewriteEngine on RewriteRule ^/([^/\.]+)/([^/\.]+)/([^/\.]+)/?$ index.php\?s=$1&q=$2&p=$3 Quote Link to comment https://forums.phpfreaks.com/topic/93635-mod-rewrite-forms/#findComment-485063 Share on other sites More sharing options...
voyde Posted March 8, 2008 Author Share Posted March 8, 2008 Yes but on form submission. Quote Link to comment https://forums.phpfreaks.com/topic/93635-mod-rewrite-forms/#findComment-487290 Share on other sites More sharing options...
powerspike Posted March 18, 2008 Share Posted March 18, 2008 <form action="site.com/bannanas/3"> but i'm going to guess that isn't what you want.... If you want it to redirect based on what the user has submitted into the form, the submit form will need to submit the data, and the script that processes it will need to use a header("Location: http://site.com/bannanas/3/"); and do it - remember that mod rewrite can't process data.... it's not a scripting language. Quote Link to comment https://forums.phpfreaks.com/topic/93635-mod-rewrite-forms/#findComment-494673 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.