Support » Plugins » Hacks » "action" parameter in forms

  • Is it OK to use the following code in forms?

    <form action="http://'. $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"] .'" method="post">


    I am not using action=”options.php” because it does not work for me. Previously I was using

    <form action="<?php $_SERVER['PHP_SELF']; ?>?page=myplugin" method="post">

    but it turned out that it does not work on some webhosts that allow “multihosting” via domain aliases and special folders for each domain (the form was sent to a nonexistent URL).

Viewing 2 replies - 1 through 2 (of 2 total)
  • WraithKenny


    Did you try action="./" or action="" which if I remember right should post to itself.

    try this:
    <form action="<?php echo admin_url('index.php?page=myplugin')" method="post">

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘"action" parameter in forms’ is closed to new replies.