Ég er komin með þennan kóða? Hvað þarf ég að bæta við?
<form name="input" action="test.html" method="post"> Texti: <input type="text" name="texti"> <input type="submit" value="Submit"> </form>
<form name="input" action="test.html" method="post"> Texti: <input type="text" name="texti"> <input type="submit" value="Submit"> </form>
<html> <head> </head> <body> <script type="text/javascript"> function writeText(txt) { document.write(txt) } </script> <form name="form1" method="post" action="text.html"> <input type="text" name="textField" length="40"> <input type="button" onclick="writeText(form1.textField.value)" value="Submit" /> </form> </script> </body> </html>
<form method="post" action=""> <input type="hidden" name="skra" value="ja"> <input type="text" name="innihald"> <input type="submit" value="Senda inn"> <?php if( "$_POST['skra']" == "ja" ) { $texti = "$_POST['innihald']"; $skipun=fopen('innihald.txt',"a"); fwrite($skipun,($texti)); fclose($skipun); } else { die("villa"); } ?> Þetta inniheldur smávegis php, en er frekar auðvelt í notkun. Kv, eth