title: PHP- Isset() function, checkin parameters
body: <p>I need help figuring out correct PHP coding for isset function.</p>
  
  <p>I am having problems understanding exactly what I need to do with the <code>isset()</code> function. Below I have the assignment directions, I have completed up to the end of <em>part b</em>, using the <code>isset()</code> function to check that the parameters exists in the query string. When I built the form, the form action is <em>"GET"</em>, because it needs to be in the query string, is that also correct?</p>
  
  <p>My only two variables are <code>Value1</code> and <code>Value2</code>, which are input by the user. </p>
  
  <p><strong>SimpleCalculator.php</strong> - Write a script that retrieves two values from the querystring, adds them together and displays the results. </p>
  
  <p>Steps:</p>
  
  <blockquote>
    <ol>
    <li><p>Copy the code from HelloForm.php and modify it to display two text boxes. Assign the values entered to variables named <code>value1</code> and <code>value2</code>.</p></li>
    <li><p>In your PHP code assign the parameters from the querystring to local variables named <code>$value1</code> and <code>$value2</code>. You will need to use the <code>isset()</code> function to check that the two parameters are in the querystring. </p></li>
    <li><p>Echo the variables to the browser to make sure they have been retrieved correctly.</p></li>
    <li><p>Add and print the values with the statement:</p>
    
    <p>echo 'Sum is: ' . ($Value1 + $Value2);</p></li>
    </ol>
  </blockquote>
  
  <p>This is what I have so far:</p>
  
  <pre><code>&lt;html&gt;
      &lt;head&gt;
          &lt;title&gt;Sample web form&lt;/title&gt;
          &lt;link href="/sandvig/mis314/assignments/style.css" rel="stylesheet" type="text/css"&gt;
      &lt;/head&gt;
  
  &lt;body&gt;
  &lt;div class="pageContainer centerText"&gt;
  
  &lt;h2&gt;Simple Calculations &lt;/h2&gt;
  &lt;hr /&gt;
  
  &lt;form method="get" &gt;
      Please enter two numbers:&lt;br&gt;&lt;br&gt;
      Value 1: &lt;input type="text" name="Value1" autofocus&gt; &lt;br&gt;&lt;br&gt;
      Value 2: &lt;input type="text" name="Value2" autofocus&gt; &lt;br&gt;&lt;br&gt;
      &lt;input type="submit" value="Add"&gt;
   &lt;/form&gt;
  
   &lt;?php
  
   $value1 = $_GET ['Value1'];
   $value2 = $_GET ['Value2'];
  
   //Retrieve name from querystring. Check that parameter
   //is in querystring or may get "Undefined index" error
  
   echo 'Value 1 was:' . ($value1);
   echo 'Value 2 was:' . ($value2);
   echo 'Sum is: ' . ($value1 + $Value2);
  
   ?&gt;
  &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>