Note that there are some explanatory texts on larger screens.

plurals
  1. POTake a user input value and insert it somewhere else in the form before submission?
    primarykey
    data
    text
    <p>Is is possible to take an input value and insert it somewhere else in the form before submission?</p> <pre><code>&lt;form action="&lt;?php echo get_option('home'); ?&gt;/wp-login.php" method="post" id="login-form"&gt; &lt;p&gt;Please login.&lt;/p&gt; &lt;input type="text" placeholder="Username" name="log" id="log" value="&lt;?php echo wp_specialchars(stripslashes($user_login), 1) ?&gt;" /&gt; &lt;input type="password" placeholder="Password" name="pwd" id="pwd" /&gt; &lt;p&gt; &lt;input name="rememberme" id="rememberme" type="checkbox" checked="checked" value="forever" /&gt; Remember me &lt;/p&gt; &lt;input type="hidden" name="redirect_to" value="&lt;?php echo $_SERVER['REQUEST_URI']; ?&gt;/&lt;?php echo $_POST['log']; ?&gt;" /&gt; &lt;p&gt; &lt;a href="&lt;?php echo get_option('home'); ?&gt;/wp-login.php?action=lostpassword"&gt;Recover password&lt;/a&gt; &lt;/p&gt; &lt;input type="submit" name="submit" value="LOGIN" class="login-button" /&gt; &lt;/form&gt; </code></pre> <p>I'd like to take the value that the user enters into this input:</p> <pre><code>&lt;input type="text" placeholder="Username" name="log" id="log" value="&lt;?php echo wp_specialchars(stripslashes($user_login), 1) ?&gt;" /&gt; </code></pre> <p>And put the value into this:</p> <pre><code>&lt;input type="hidden" name="redirect_to" value="&lt;?php echo $_SERVER['REQUEST_URI']; ?&gt;/&lt;?php echo $_POST['log']; ?&gt;" /&gt; </code></pre> <p>I'd given it a go by putting in <code>S_POST['log']</code> but that doesn't work.</p> <p>Can anyone help? </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload