Jump to content

Form > URL change help


conker87

Recommended Posts

Hey guys. I'm reorganising my site, which also means I'm doing some mod_rewriting. Now that makes it all nice and pretty, but doesn't bode well for searches. I'm using a simple text box and button for this. However my search url is now: /search/<search> rather than ?search=<search>

 

My question is, is there anyway using PHP to change the url the form submits to?

Link to comment
https://forums.phpfreaks.com/topic/204344-form-url-change-help/
Share on other sites

Aye, I know. But I wanted to change where the search form submitted to. I did a little header redirection, I'm not sure if it's the best course of action, but ti works none the less.

if (sanitise($_POST['search'])) header("Location: /search/" . sanitise($_POST['search']));

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.