issue with form method get on next page, would like for people to not see the initial page unless they hit the submit button
<p>I have two PHP files.</p>

<p>The first is called "file1.php":</p>

<pre><code>&lt;form action="file2.php" method="get"&gt;
&lt;input type="hidden" name="price" value="50"&gt;
&lt;input type="hidden" name="id" value="1"&gt;
&lt;input type="submit" border="0" name="submit" value="Buy Now"&gt;
&lt;/form&gt;
</code></pre>

<hr>

<p>The second is called "file2.php":</p>

<pre><code>&lt;form action="&lt;?php echo $_SERVER['PHP_SELF']; ?&gt;" method="post"&gt;
&lt;input type="text" id="id" name="id" value="&lt;?php echo $_GET["id"]; ?&gt;" alt="&lt;?php echo $_GET["price"]; ?&gt;" readonly="readonly" /&gt;
&lt;/form&gt;
</code></pre>

<hr>

<p>Now here's my issue:</p>

<p>Some people may look at the source of the page on file1.php and try visiting file2.php. I would want them to be automatically redirected the file1.php or not be able to see file2.php UNLESS they have clicked the submit button from file1.php.</p>

<p>Also some people might try erasing the data was sent from the GET method from the previous page (file1.php), to be able to view file2.php, is there a way to block this from happening? I wouldn't want it to show a 404 error, but simply redirect the person to the file1.php page unless they click on one of the submit buttons from file1.php as there are many forms.</p>

<hr>

<p>I believe this might have something to do with PHP require to be placed on file2.php, but not quite sure how to get it working properly.</p>

<p>Any ideas?</p>

<hr>

<h2><em>EDIT</em> (below)</h2>

<p>Thank you everyone so far for all your help and advice.</p>

<p>Alright, so everything seems to be working now using the form method POST. However, to get this working, we must list all variables for each template. Each template has 4 variables. 2 IDs and 2 prices. In example:</p>

<pre><code>$T900_0001_R_ID = "#900-0001 - Regular"; 
$T900_0001_R = 75; 
$T900_0001_E_ID = "#900-0001 - Exclusive"; 
$T900_0001_E = 500; 
</code></pre>

<hr>

<p>Now, my next question is: how do we convert this code to be used into a MySQL database instead, as there will be hundreds, and maybe thousands of templates to sold within just the next few weeks?</p>

<hr>

<h2>See the updated files that are working (without MySQL):</h2>

<p>file1.php:</p>

<pre><code>&lt;?php
$T900_0001_R_ID = "#900-0001 - Regular"; 
$T900_0001_R = 75; 
$T900_0001_E_ID = "#900-0001 - Exclusive"; 
$T900_0001_E = 500; 

echo "&lt;form action='test2.php' method='post'&gt;&lt;input type='hidden' name='template_price' value='" . $T900_0001_R . "'&gt;&lt;input type='hidden' name='template_id' value='" . $T900_0001_R_ID . "'&gt;&lt;input type='submit' class='buynow' border='0' name='submit' value='Buy Regular'&gt;&lt;/form&gt;";
?&gt;
</code></pre>

<p>file2.php:</p>

<pre><code>&lt;?php
$T900_0001_R_ID = "#900-0001 - Regular"; 
$T900_0001_R = 75; 
$T900_0001_E_ID = "#900-0001 - Exclusive"; 
$T900_0001_E = 500; 

echo "&lt;form&gt;&lt;input type='text' id='template_id' name='template_id' value='" . $_POST["template_id"] . "' alt='" . $_POST["template_price"] . "' readonly='readonly' class='input-text sum' /&gt;&lt;/form&gt;";
?&gt;
</code></pre>
