This may help, may not:
Hope it does.
PAGE 1
*************** ADDS NEW QUESTION FORM AND WRITES THE TO QUESTION.TXT
PAGE *********************
<?php
$filename = "question.txt";
$seperator = "/ENDOFLINE/";
if (isset ($_POST['Submit'])){
$new_question = sprintf ("%s$seperator\r\n%s$seperator\r\n",
addslashes($_POST['question']), addslashes($_POST['answer']));
if (!$handle = fopen($filename, "r+")){
echo "cannot open file to edit question";
exit;
}
fwrite ($handle, $new_question);
fclose ($handle);
header ("Location:viewquestion.php");
exit;
}
?>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>"
method="post">question:<input name="question" type="text"><br>
answer:<input name="answer" type="text"><br>
<input name="Submit" type="submit" value="Submit">
</form>
PAGE 2
********* WILL PLACE ALL OF THE QUESTIONS AND ANSWERS INTO AN ARRAY
******
**** >SPLIT THEM UP INTO A QUESTIONS AND ANSWERS ARRAY IF YOU WISH<
******
<?php
$filename = "question.txt";
$seperator = "/ENDOFLINE/";
if (!$handle = fopen ($filename, "r")){
echo "cannot access question file";
exit;
}
$contents = fread ($handle, filesize ($filename));
fclose ($handle);
$all = explode ($seperator, $contents);
foreach ($all as $question){
echo stripslashes($question).'<br>';
}
?><!-- ~MESSAGE_AFTER~ -->
>> Stay informed about: very simple one line cms?