Mudancas Recentes - Buscar:

Principal

 Objetivos  
 Ementa  
 Livros 

OAC

LOAC

Professores:

  JOSEANA
  ELMAR

CONTATO

CRÉDITOS

editar



OAC /

PHP

Código para processar uma requisição HTTP com argumentos

<html>
 <head>
  <title>PHP Test</title>
 </head>
 <body>
 <?php
   if( $_GET["name"] || $_GET["data"] )
   {
      // open HTML file that can be read using a browser
      $sent_file = fopen("sent.html", "w") or die("Unable to open file!");
      fwrite($sent_file,"<html><head><title>Data File</title></head><body>\n");
      // erase any characters that a hacker could use to execute dangerous code
      fwrite($sent_file,"<p>Name: " . strtr($_GET['name'],"<>?","___") . "<p>\n");
      fwrite($sent_file,"<p>Data: " . strtr($_GET['data'],"<>?","___") . "<p>\n");
      fwrite($sent_file,"</body></html>\n");

      echo "Name =" . $_GET["name"] . "<br>";
      echo "Data =" . $_GET["data"] . "<br>";
   }
   echo "<A HREF=http://labarc.ufcg.edu.br/php/sent.html>Display created HTML file</A>";
 ?>
 </body>
</html>
© 2008 Profs. Elmar Melcher e Joseana Fechine. Monitores: Sergio Espinola e Fabricio Lelis - DSC/UFCG
Modificada em May 09, 2018, at 10:29 AM