Forum Moderators: coopster
I was wondering if there was any way to use PHP to insert constant values into a form? Basically I want to stay away from using an html form with a hidden attribute to the input tag.
Let's say my constant value is 55.21. This value has to be included in the form when it gets processed but I don't want anybody to be able to View Source, or download the page and then View Source (which wipes out the whole slew of Right Click Disable scripts.
Any help is greatly appreciated.
Thanx in advance.
I'm not wanting to insert the constant value into a table but rather into a form. My concern is this I have about five different values that need to passed through the form but I do not want those value to be displayed so normally you'd use (in html):
<input type="hidden" name="creditcardnumber" value="constant value" />
However, when you do this the user can see the value that you want hidden by right clicking on the page and choosing View Source. If I add a No Right Click script then they can still use the keyboard to view the source. So I've included this statement in my code (html):
<body oncontextmenu="return false;"
This stops the keyboard as well as right mouse button from Viewing Source. However, if a person uses the browser menu and chooses Save As, then opens the page in an editor or even Notepad for that matter my constant values that I am wanting to keep hidden are there for the user to see.
What I am actually wondering about is whether or not there is a way to hide these values and still pass them to the action page of the form?
class MyValues_t
{
var $Var1;
var $Var2;
var $Var3;
var $Var4;
var $Var5;
}
$MySecretValues = new MyValues_t();
//
// assignment of values in $mySecretValues
//
$HiddenString = [url=http://www.php.net/manual/en/function.base64-encode.php]base64_encode[/url]([url=http://www.php.net/manual/en/function.serialize.php]serialize[/url]($MySecretValues));
echo "<input type='hidden' name='myvalues' value='$HiddenString' />";
$MySecretValues = [url=http://www.php.net/manual/en/function.unserialize.php]unserialize[/url]([url=http://www.php.net/manual/en/function.base64-decode.php]base64_decode[/url]($_GET['myvalues']));