Refering form submmit to rewrited URL

Hello.
I have a form with 2 inputs.
My goal is to redirect the user to:
mysite.com//input1/input2
How I can do this? It’s like a using $_GET & HTaccess but I have no idea how to do this.

It can’t be done with rewriting, because rewriting is used to parse URLs but not to build them.
You have to create some server-side script and specify it in the form’s action attribute.
This will also allow you to validate entered values because you don’t want someone enters “…/…/…/…/etc/passwd” in your input.

PHP example:

<?php
    $input1 = $_POST['input1'];
    $input2 = $_POST['input2'];
    /* ... validate values here ... */
    header("Location: /{$input1}/{$input2}");

Thank you sir!

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.