topical media & game development

talk show tell print

mashup-delicious-06-example6-3.php / php



  <?php
  if (isset(_GET['number'])) {
      result = sqrt(_GET['number']);
  }
  ?>
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
  <title>PHP Square Root Calculator</title>
  </head>
  <body>
  <form>
      Get the square root of:
      <input type="text" name="number" size="3" />
      <input type="submit" value="Calculate" />
  </form>
  <?php
  if (isset(result)) {
      echo"<div>Last result: result</div>";
  }
  ?>
  </body>
  </html>
  


(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.