Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>As Jimmie Johansson mentioned before this is really basic stuff and easy to search for.</p> <pre><code>Hi &lt;?php echo htmlspecialchars($_POST['name']); ?&gt;. You are &lt;?php echo (int)$_POST['age']; ?&gt; years old. </code></pre> <p>Source: <a href="http://www.php.net/manual/en/tutorial.forms.php" rel="nofollow">http://www.php.net/manual/en/tutorial.forms.php</a></p> <p>This is an example which i found in about 10 seconds. But enough of the flame lets get to business.</p> <p>If you transmit data via a FORM to php there are to ways to transmit the data. The first one ist via GET the other way is via POST.</p> <p>If you choose GET your information will be stored as URL-Parameters</p> <blockquote> <p>An associative array of variables passed to the current script via the URL parameters.</p> </blockquote> <p>Source: <a href="http://www.php.net/manual/en/reserved.variables.get.php" rel="nofollow">http://www.php.net/manual/en/reserved.variables.get.php</a></p> <p>Post instead just sends the data to the PHP-Script so you can use this data like GET but you do not have any URL-Parameters here.</p> <blockquote> <p>An associative array of variables passed to the current script via the HTTP POST method.</p> </blockquote> <p>Source: <a href="http://www.php.net/manual/en/reserved.variables.post.php" rel="nofollow">http://www.php.net/manual/en/reserved.variables.post.php</a></p> <p>To choose one of this two Methods you have to edit your HTML-Form</p> <p>Now that we transmitted the data either with GET or POST we can access them in PHP via the global variables</p> <pre><code>$_GET </code></pre> <p>and</p> <pre><code>$_POST </code></pre> <p>They are <a href="http://php.net/manual/de/language.types.array.php" rel="nofollow">Arrays</a> and you can access specific data with a key which represents the name of the input field or other form constructs. In your example the input fields name is "test" so we would access it like this</p> <pre><code>&lt;?php $_GET["test"]; ?&gt; </code></pre> <p>You can use </p> <pre><code>&lt;?php ... ?&gt; </code></pre> <p>Wherever you want in your HTML-Code as long it's an PHP File. So if you want to output something via PHP just use the and put you statements between them.</p> <pre><code>&lt;input type="text" name="test" value="&lt;?php echo $_GET['your_parameter']; ?&gt;" /&gt; </code></pre> <blockquote> <p>Documentation</p> </blockquote> <p>Arrays: </p> <ol> <li><a href="http://php.net/manual/de/language.types.array.php" rel="nofollow">http://php.net/manual/de/language.types.array.php</a></li> </ol> <p>Forms: </p> <ol> <li><a href="http://www.php.net/manual/en/tutorial.forms.php" rel="nofollow">http://www.php.net/manual/en/tutorial.forms.php</a></li> <li><a href="http://www.w3schools.com/php/php_forms.asp" rel="nofollow">http://www.w3schools.com/php/php_forms.asp</a></li> </ol> <p>PHP and HTML: </p> <ol> <li><a href="http://www.php.net/manual/en/faq.html.php" rel="nofollow">http://www.php.net/manual/en/faq.html.php</a></li> </ol> <p>POST and GET:</p> <ol> <li><a href="http://php.net/manual/de/reserved.variables.post.php" rel="nofollow">http://php.net/manual/de/reserved.variables.post.php</a></li> <li><a href="http://php.net/manual/de/reserved.variables.get.php" rel="nofollow">http://php.net/manual/de/reserved.variables.get.php</a></li> </ol> <blockquote> <p>Further Reading</p> </blockquote> <p>Further reading</p> <ul> <li><a href="http://en.wikipedia.org/wiki/Separation_of_presentation_and_content" rel="nofollow">http://en.wikipedia.org/wiki/Separation_of_presentation_and_content</a></li> <li><a href="http://wp.tutsplus.com/tutorials/creative-coding/improving-your-work-flow-separate-your-mark-up-from-your-logic/" rel="nofollow">http://wp.tutsplus.com/tutorials/creative-coding/improving-your-work-flow-separate-your-mark-up-from-your-logic/</a></li> <li><a href="http://www.w3schools.com/tags/ref_httpmethods.asp" rel="nofollow">http://www.w3schools.com/tags/ref_httpmethods.asp</a></li> </ul> <p>And the important things at the end. For security you should check what was entered into the input field</p> <p><a href="http://www.w3schools.com/php/php_form_validation.asp" rel="nofollow">http://www.w3schools.com/php/php_form_validation.asp</a></p> <p>Sorry for my englisch! If you have problems to follow my answer feel free to ask me. Check the links!</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.
    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