write response

A

Anonymous

Guest
Code:
<html> 
<head> 
<title> 
</title> 
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head> 
<body bgcolor="#FFFFFF" text="#000000" link="#000000" vlink="#000000" alink="#000000"> 
<form method="post"> 
<p align="center"><font color="#000000" size="2" face="Arial, Helvetica, sans-serif">Nombre: 
    <input type="text" name="name">
</font></p>
<p align="center"><font color="#000000" size="2" face="Arial, Helvetica, sans-serif">Descripción:<strong><br>
      <textarea name="description" cols="30" rows="10" id="description"></textarea>
</strong></font></p>
<p align="center"><strong><font color="#000000" size="2" face="Arial, Helvetica, sans-serif">
  <input type="reset" name="Reset" value="Borrar">    
  <input type="submit" value="Grabar"> 
  </font></strong></p>
</form> 
</body> 
</html> 
 
<?php 
$content = "Name=".$_POST["name"]."&Description=".$_POST["description"]; 

if ($fp = @fopen("data.txt","wb") ) {
  echo "unable to open the file for writing" ;
}else {
   if (@fwrite($fp,$content)) {
       echo "File written successfully";
   }  else {
       echo "error writing the file";
   }
|
  
fclose($fp);
?>
 
Ruturajv, please don't just post big chunks of code. Big chunks of code are not answers and do not teach anybody anything. Answer questions by explaining what, specifically, is wrong with what the poster is doing, and then explaining what they should do instead.
 
Back
Top