Jump to content

mod_rewrite and form submitting?


danmerrino

Recommended Posts

hello helpful php experts (and i hope this is the right place to post my first post),

 

i am working on a site on which i use htaccess files and the mod_rewrite to make the urls more search engine friendly (domain.com/examples/1 takes you to domain/examples?example=1)

 

my question is about the submission of search and other forms.

 

the way i am doing it right now, is by submitting for example a search query to the same page via the post method and then using redirect in a piece of code at the very top of the page with for example:

 

if(isset($_POST['query']) header("Location: domain.com/search/$_POST[query]");

 

this works just fine, except for the fact that it is rather slow and cumbersome.

 

i was wondering if anybody knows of a better way of submitting forms with these rewritten urls (without any js)

 

any answers or helpful suggestions would be greatly appreciated  ???, greetings,

dan

 

Link to comment
https://forums.phpfreaks.com/topic/126493-mod_rewrite-and-form-submitting/
Share on other sites

thanks for answering finally somebody... :-\

 

i somehow forgot to mention that it would be important for the user to be able to copy paste the url and then get the desired results, something that would not be possible when passing the value with POST...

 

...help?  :'(

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.