Example #1
0
?>

  <div id="text">
    <form id="wotdForm" method="post" action="<?php 
echo $_SERVER['PHP_SELF'];
?>
">
      <p>Enter your email to receive the <strong>Word of the Day</strong></p>
      <label><input class="text" type="text" id="email" name="email" /></label>
      <label><input class="submit" type="submit" name="submit" value="Submit" /></label>
    </form>

    <div id="response">
      <?php 
if (isset($_POST['email'])) {
    $cfg->checkEmail($_POST['email']);
}
?>
    </div>

    <div id="random">
      <?php 
echo $cfg->getRandomWord();
?>
    </div>

    <form id="refreshForm" method="post" action="<?php 
echo $_SERVER['PHP_SELF'];
?>
">
      <label><input class="submit" type="submit" name="refresh" value="Refresh" /></label>
Example #2
0
<?php

function __autoload($class)
{
    require_once "/home/benjamin/public_html/italy/lib/php/classes/{$class}.php";
}
$cfg = new ItalyDAO();
switch ($_GET['function']) {
    case "check_email":
        $cfg->checkEmail($_GET['email']);
        break;
    case "conjugate_verb":
        $cfg->conjugateVerb($_GET['verb'], $_GET['tense']);
        break;
    case "random_word":
        $cfg->getRandomWord();
        break;
}