Passing on unseen variables

I have a form using the Post method, it passes on the values of the form inputs to variables in the PHP script that processes it.

<input type="text" name="title" />

That’s no problem.
I can pass on values from hidden inputs that viewers don’t see, but they do appear in the HTML code, so bots or anyone who looks at the source code will see it.
I write:

echo "<input type=\\"hidden\\" name=\\"secretnumber\\" value=\\"$mynumber\\" />";

The page code shows:

<input type="hidden" name="secretnumber" value="4" />

Is there a way to set values with PHP code in the form page, that appear in the Post array on the next page, but are unseen in the HTML of the form page?

There are probably some convoluted ways you can make that happen with, say, encryption. But the best answer is: If it has to stay private, then don’t send it out in the HTML. Instead, store it in a session or in your database for you to retrieve during the next request.

Im going to take a guess that you are trying to POST data to the next page without it being seen. This is what php sessions are for.

Thanks for the answers. I sort of assumed it would be something fairly simple I was missing, somehow like adding a value to an array. But it’s maybe not that simple afterall.
In reality, it is not as explicit as the code I posted, with the name ‘secretnumber’, and the number is substituted for a letter, not in the obvious way like a=1, b=2 etc… so it’s a very lose form of encyption. The number isn’t someones banking details or the coords of the holy grail or anything, so it doesn’t have to be super secure. It’s a randomly generated number for part of a captcha method I’m experimeting with. But I thought the more secure, the more effective the captcha, I didn’t want to give away any clues. Being randomly generated on page load, it’s not always the same, so I wouldn’t store it in a file.
Sessions is something I have yet to look into, sounds like it may be what I’m looking for. I will have a read about sessions and see what I come up with.