1

How to pass values by using post method to a redirected dynamic page in .htaccess file

  • Welcome to Stack Overflow. Even if your question may be interesting, please consider that "How to" questions does not fit the standard questions for this site. http://stackoverflow.com/faq#questions. Find docs, try by yourself, and if you are stucked, we may help you. – Jean-Rémy Revy Jul 19 '12 at 07:52

4 Answers4

1

You can't use POST in htaccess redirects.

Maybe this question will help you: PHP Redirect with POST data

Community
  • 1
  • 1
Sven van Zoelen
  • 6,989
  • 5
  • 37
  • 48
1

If you want the data in next page you can use sessions also

mrsrinivas
  • 34,112
  • 13
  • 125
  • 125
  • 1
    which comes close to the Post-Redirect-Get-Pattern: http://en.wikipedia.org/wiki/Post/Redirect/Get – mdo Jul 18 '12 at 11:03
0

Redirects are always GET there is nothing that can be done about this. Is there any reason you want to POST values to a redirected page?

Jon Taylor
  • 7,865
  • 5
  • 30
  • 55
  • reson is i want to hide id values and session values in redirected my original url is like xklsv.me/viewblog.php but my required url is xklsv.me/author/title/ where author and title are variables in viewblog.php page that contain session, id also – Arun Kumar Aug 16 '12 at 09:35
0

You can send the form values using hidden fields.

    $action = 'http://abac.com/abc.php';
    $form = '<form id="frm" name="frm" action="'.$action.'" method="post">';
    $form .= '<input type="hidden" id="title" name="title" value="'.$_POST['title'].'">';
    $form .= '<script>document.frm.submit();</script>';
    $form .= '</form>';
    echo $form;
    exit;

Hope it will work

Thanks

Mohit Singh
  • 142
  • 9
  • i want to hide id values and session values in url my original url is like xklsv.me/viewblog.php but my required url is xklsv.me/author/title/ where author and title are variables in viewblog.php page Thank you – Arun Kumar Aug 16 '12 at 09:37