Objetivos Ementa Livros Professores: JOSEANA ELMAR
|
OAC /
PHPCó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> |