2
I would like to know how to store data from a form, there will be a presentation in the course and I would like the people who access my page to leave a comment about what they thought... I was wondering if this is possible only with Javascript, the comments could be stored in a Text document... I don’t know how this works. My HTML structure
<html>
<style type="text/css">
body{
background: white;
url("comentario/fundocomentario.jpg") top left repeat-x fixed;
}
</style>
<img src="comentario/deixeseucomentario.png" width=500 height=100>
<font size=5 color="black" face="Broadway">
<font size=4 color="#8B0000" face="Broadway">
<form name="cadastro">
<img src="comentario/comentarionome.png" width=50 height=25>
<input type="text" name="nome" id="nome" maxlength=30 size=50 style="background-color:#98F5FF;color:#8B0000;font-size:15px">
<br>
<img src="comentario/comentarioemail.png" width=50 height=25>
<input type="text" name="email" id="email" maxlength=30 size=49 style="background-color:#98F5FF;color:#8B0000;font-size:15px">
<br>
</font>
<font size=4 color="black" face="Broadway"><br>
<img src="comentario/achou.png" width=350 height=40>
<br>
<textarea id="comentario" name="comentario" cols=62 rows=5 style="background-color:#98F5FF;color:#8B0000;font-size:15px">
</textarea>
<input type="button" value="salvar" src="salvar" onclick="salvar()">
<iframe id="conteudo" style="display: none"></iframe>
</form>
<br>
<img src="comentario/comentariocentro.png" width=400 height=40>
</html>
A basic example in php : <? php $text = $_POST['input_text']; // Opens or creates the bloco1.txt // "a" represents that the file is opened to be written $Fp = fopen("bloco1.txt", "a"); // Writes what was taken from 'input_text' in the bloco1.txt $writes = fwrite($Fp, $text); // Closes the file fclose($Fp); -> OK ?>
– mauricio caserta
Javascript is possible, but the data would only be saved on the user’s local machine. That is, it would be useful for you only if all users register on the same machine. Otherwise each registration would be on a machine.
– DontVoteMeDown
In case it would be a computer for each group... I will try to use in php dps. Thanks for the help!
– Karina
Can you explain how you want to integrate this data? Users could send this form to a server and save it to a comic or file.
– Sergio
It would only be a place for people who access the page to interact and comment on what they found... Name, and comment only...
– Karina