Location: PHPKode > projects > Readenglish > readenglish/english_readenglish.php
<?php
session_start ();

include ("english_readenglish_con.php");

$error = "";
$estado = "init";
$texto_resultado = "";
$inicio = 0;
if (isset ($_REQUEST["init"])) {
    $estado = "init";
    $ret = english_readenglish_revisar_inicio ($inicio);
    if (! $ret) {
        $error = errores_leer();
    } else {
        if (english_readenglish_palabras_no_encontradas ()) {
            $estado = "words";
        } else {
            $estado = "result";
        }
    }
} else if (isset ($_REQUEST["words"])) {
    $estado = "words";
    if (english_readenglish_palabras_no_encontradas ()) {
        $ret = english_readenglish_words_insertar ();
        if (! $ret) {
            $error = errores_leer();
        } else {
            $estado = "result";
        }
    } else {
        $estado = "result";
    }
}
if ($estado == "result" || isset ($_REQUEST["result"])) {
    $ret = english_readenglish_traducir ($texto_resultado);
    if (! $ret) {
        $error = errores_leer();
    } else {
        $estado = "result";
        $error = english_readenglish_mensaje_no_encontradas ();
    }
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<link href="images/favicon.ico" rel="shortcut icon"/>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<title>readenglish: english-readenglish</title>
<link href="readenglish.css" rel="stylesheet" type="text/css">
</head>
<body>
<form name="form1" method="post" action="<?php echo $_SERVER["PHP_SELF"]; ?>">
<table width="100%" border="0" cellpadding="5" cellspacing="0"> 
  <?php include "header_vis.php"; ?>
  <tr>
    <td width="100" valign="top"> <?php include "menu_vis.php"; ?> </td>
    <td valign="top" bgcolor="#FFFFFF">
    <table width="100%" border="0" cellpadding="5" cellspacing="0">
    <tr>
    <td valign="top">
    <table width="100%"  border="0" cellspacing="0" cellpadding="5">
    <?php 
    if ($estado == "init") { ?>
      <tr>
        <td>Input the English text to be changed:</td>
      </tr>
      <tr>
        <td><textarea name="texto" cols="100%" rows="20" class="texto"></textarea></td>
      </tr>
      <tr>
        <td><div align="center">
            <input type="submit" name="init" value="Send">
            <input type="submit" name="result" value="Send but no check new words">
          </div></td>
      </tr>
    <?php } else {
        if ($estado == "words") { ?>
          <tr>
            <td>The next words were not found in the dictionary. Please help us to upgrade it (see the <a href="rules.php" target="_blank">rules</a> to get information):</td>
          </tr>
          <tr>
            <td><table width="100%"  border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td><div align="left" class="cabecera">Up</div></td>
                  <td><div align="center" class="cabecera">Word</div></td>
                  <td class="cabecera"><div align="right">Vowel accent' </div></td>
                  <td width="1%" class="cabecera"><div align="center">Changes (&middot; : . c h j s z vowel)</div></td>
                  <td class="cabecera"><div align="left">' Vowel accent </div></td>
                </tr>
                <?php
                if (isset ($_REQUEST["init"])) {
                    $ret = english_readenglish_revisar_fin ($inicio);
                } else {
                    english_readenglish_words_listado ();
                }
                ?>
              </table></td>
          </tr>
          <tr>
            <td><div align="center">
                <input type="submit" name="words" value="Send up marked and continue">
              </div></td>
          </tr>
       <?php } else if ($estado == "result") { ?>
          <tr>
            <td>Text changed to readenglish :</td>
          </tr>
          <tr>
            <td><textarea name="texto" cols="100%" rows="20" class="texto"><?php
            // <pre class="texto">
            echo htmlentities ($texto_resultado);
            // </pre>
            ?></textarea></td>
          </tr>
          <tr>
            <td><div align="left">
                <input type="submit" name="more_text" value="More text change">
              </div></td>
          </tr>
       <?php }
        ?>
    </table>
    </td>
    <input name="texto" type="hidden" id="texto" value="<?php echo htmlentities($_REQUEST["texto"]); ?>">
    <?php
    }
    ?>
    </tr>
    <?php if ($error != "") { ?>
    <tr>
        <td valign="top" bgcolor="#FFFFFF"><span class="error"><?php echo $error; ?></span></td>
    </tr>
    <?php } ?>
    </table>
    </td>
</tr>
</table> 
</form>
</body>
</html>
Return current item: Readenglish