I would like it to look something like this.
word = definiton
contributed by: name
I have tried a few solutions myself and continue to receive different errors with each fix, so perhaps someone can help me.
Code: Select all
<form action="test.php" method="POST">
<p><b>your name</b>
<input type="text" name="name" size="30"></p>
<p><b>your word</b>
<input type="text" name="word" size="30"></p>
<p><b>definition</b>
<TEXTAREA NAME="definition" COLS="30" ROWS="5"
WRAP="virtual"></TEXTAREA></P>
<p><input type="submit" name="submit" value="send your word!"></p>
<?php
if ($_POST['name'] = "" &&
$_POST['word'] = "" &&
$_POST['definition'] ="")
{
echo "Please fill out all boxes so I can see your great word";
}
else {
$fp = fopen("words.txt", "a");
if(!$fp) {
echo "WtF mate, it seems we've found an error";
exit;
}
}
## ERROR HERE > $name == echo"contributed by" . {$_POST['name']}
fwrite($fp, $word ." = " .$definition /n
.$name)
fclose($fp)
?>I know you need to use explode() to turn strings into arrays, would that work in my sittuation and can anyone provide a decent example of how I'd implement it. Thanks!