Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><code>$_REQUEST</code> Contains data which is gathered from cookies, <code>$_POST</code> and <code>$_GET</code> .. Are you sure that your data is properly assigned? </p> <p>Take this example.</p> <p><code>print_r($_REQUEST);</code> just doing that without no <code>&lt;form method="get/post"&gt;</code> will produce a blank array, that might be why you are getting nothing</p> <p>Your snippet is correct.. you are lacking a html form to go with that..</p> <p>Example: </p> <pre><code>&lt;form method="POST"&gt; &lt;input type="submit" name="test" value="ThisIsCorrect"&gt; &lt;/form&gt; </code></pre> <p>With your code you have shown your question.. your <code>$_REQUEST</code> array will return the value of the button. In this case "ThisIsCorrect"</p> <hr> <p>Moral Of this?</p> <p>Ensure that you are using using post/get/cookies before calling the $_REQUEST, and for future reference, just using $_POST &amp; $_GET is cleaner to use.. But that is down to my personal preference. </p> <hr> <p>How is the $_REQUEST Array constructed?</p> <p>Consider this: </p> <p></p> <p>the array will contain the <code>name</code> as the array key and the value as the value.. </p> <p>So taking this into account: </p> <pre><code>&lt;form method="POST"&gt; &lt;input type="text" name="username"&gt; &lt;input type="submit" name="test" value="ThisIsCorrect"&gt; &lt;/form&gt; </code></pre> <p>For your text box &amp; Submit button the array will be:</p> <p><code>array ("username" =&gt; "UserInputData", "test" =&gt; "ThisIsCorrect");</code></p>
 

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