Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>When you are assigning the _SESSION url, you will need to use the posted variable to assign the string.</p> <pre><code>$_SESSION['url'] = $_GET['url']; </code></pre> <p>To do the opposite, and have the textbox show the value of the session, you would:</p> <pre><code>echo "&lt;input type='text' id='starurl' value='" . htmlspecialchars($_SESSION['url']) . "'/&gt;"; </code></pre> <p>It is important to note that if you want the text box to actually <em>do</em> something, you will need to have the input box wrapped around a form tag.</p> <p>The <code>&lt;form&gt;</code> tag tells the browser where the form starts and ends. You can add all kinds of HTML tags between the <code>&lt;form&gt;</code> and <code>&lt;/form&gt;</code> tags. <a href="http://www.echoecho.com/htmlforms03.htm%5C" rel="nofollow noreferrer">(thanks echoecho!)</a></p> <p>If you are working RESTfully, GET should be used for requests where you are only getting data, and POST should be used for requests where you are making something happen.</p> <p>Some examples:</p> <ul> <li>GET the page showing a particular SO question</li> <li>POST a comment</li> <li>Click the "Add to cart" button and send a POST request.</li> </ul> <p>(<a href="https://stackoverflow.com/a/3477384/2143004">Thanks Skilldrick!</a>)</p> <p>The form &amp; PHP file would look like this:</p> <pre><code>&lt;?php session_start(); if (isset($_POST['url']) { $_SESSION['url'] = $_POST['url']; } echo '&lt;form action="POST" method="?"&gt;'; echo "&lt;input type='text' id='starurl' value='" . htmlspecialchars($_SESSION['url']) . "'/&gt;"; echo '&lt;/form&gt;'; </code></pre> <p>You will notice when the form is updated, the session updates too. When you close your browser and open it again, you will see you old contents on the input box. (Press "enter" to save the input box without a submit button).</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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      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