title: PHP: Passing a class instance to another page?
body: <p>I'm trying to implement a captcha system, and I found a nice and very simple class trough google that does what I want.</p>
  
  <p>it's something like:</p>
  
  <pre><code>$captcha = new Captcha();
  $prefix = mt_rand();
  $image = $captcha-&gt;generate($prefix);
  </code></pre>
  
  <p>then I add the image in the form:</p>
  
  <pre><code>&lt;img src="&lt;?php echo $image; ?&gt;" /&gt;
  &lt;input name="captcha" type="text" value="Type the security code from above" /&gt;
  </code></pre>
  
  <p>it works fine so far, but I don't know how to check if the submitted code matches the captcha.
  In the documentation, it says I have to do it with:</p>
  
  <pre><code>$correct = $captcha_instance-&gt;check($prefix, $_POST['captcha']);
  </code></pre>
  
  <p>but the problem is that after the form is submitted <code>$captcha</code> and <code>$prefix</code> are gone...</p>
  
  <p>How do I pass these variables after the form is submitted to the next page?</p>