This has been confusing me for a while. I don't understand why it isn't working. In my original coding, I have an action called submitted.php and this is what is looks like:
This isn't the full code but my problem is that it doesn't do anything after I open that first file hence it doesnt print "name". But oddly, it prints all the things in the end: "Thank you for submitting..."w hich is not related to the opening of the file. Any help would be greatly appreciated.><
Code:
<?php
$data=fopen("/home/vchan/ts2/writing.txt","r+");
while(!feof($data)){
$data2=fgets($data);
$tmp=explode(",",$data2);
$project=$tmp[0];
$code=$tmp[1];
$realname=$tmp[2];
$counter=$tmp[3];
$dateentry=$tmp[4];
$name=$tmp[5];
$hours=$tmp[6];
$description=$tmp[7];
echo '$name';
}
fclose($data);
?>
<html>
<body>
<?php
echo 'Thank you for submitting. <br> To submit another, please click here.';
?>
</body>
</html>
<?php
echo '<form action="test5.php" method="post"> ';
echo'<p><input type="submit" value="Submit Another"/></p>';
echo '</form>';
?>
Comment