Hi There,
I hope this quesiton isn't too dumb!
I have a page with a text input form, and the data in the form gets entered into a variable ($OrderID), which gets written to a text file on the web server.
After data is entered, the page reloads and the user can enter more data. I have included the relevant snippits of code below.
The problem is, when someone manually refreshes the page, or the first time they visit the page, the site writes the text file to the web server with an empty space where the variable goes. Just wondering if there's a way around this without using javascript to validate the form input?
Hope that makes sense!
Ant.
code:
$OrderID = $_POST["OrderID"];
<SCRIPT>
function setFocus() { document.form1.OrderID.focus() }
</SCRIPT>
<BODY onLoad=setFocus()></body>
OrderID:<FORM name=form1 method="post" action="<?php echo $PHP_SELF;?>">
<input name="OrderID" size="12" maxlength="48" type="text"></input>
</FORM>