How can this work? : <p>I know this code doesn't work. I want to pass $var1, $var2, and name to next.php. How can I do that?</p>

<pre><code>&lt;?php
    $var1="test1";
    $var2="test2";
?&gt;

&lt;form method="get"&gt;
    &lt;input type="text" name="name"&gt;
    &lt;a &lt;?php echo "href='next.php?test1=".$var1."&amp;test2=".$var2."'"?&gt; &gt;next&lt;/a&gt;
&lt;/form&gt;
</code></pre>

<p>in next.php</p>

<pre><code>$var1=$_GET['name'];
$var2=$_GET['test1'];
$var3=$_GET['test2'];
</code></pre>
