Sorry if this is a repost, i didn't find an article that gives a solution to this issue.
Here's my example code:
<?php
echo "<form action=\"test2.php\" method=\"post\">";
echo "<input type=\"text\" name=\"ent1\">";
$queue = $_POST["ent1"];
$fh = fopen("temp.txt", 'w');
fwrite($fh, $queue);
fclose($fh);
echo "<input type=\"submit\">";
?>
This code should write whatever i type in the text box to the file "temp.txt" but it doesn't. It has something to do with the form action. It works fine if I take out the action and just use:
echo "<form method=\"post\">";
is there a way around this issue? I need to call an action when I click on my submit button and write to a file at the same time.