PHP Classes

Get start to use

Recommend this page to a friend!

      PHP Forms Class with HTML Generator and JavaScript Validation  >  PHP Forms Class with HTML Generator and JavaScript Validation package blog  >  Locating addresses on...  >  All threads  >  Get start to use  >  (Un) Subscribe thread alerts  
Subject:Get start to use
Summary:Please help with sample codes
Messages:13
Author:Wah Y Lam
Date:2007-09-30 03:52:23
Update:2007-10-02 14:32:55
 
  1 - 10   11 - 13  

  11. Re: Get start to use   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2007-10-01 19:17:16 - In reply to message 10 from Wah Y Lam
To get the values of a checkbox, just call the form class function GetCheckedState. It returns a boolean value.

You can pass any values to a new page in the URL, but that is not a very safe solution.

It means that an attacker can access the other page directly with whatever values he wants to inject in your application, thus by passing the form validation.

It is more recommended that you validate and process the form in the same script.

  12. Re: Get start to use   Reply   Report abuse  
Picture of Wah Y Lam Wah Y Lam - 2007-10-02 12:18:36 - In reply to message 11 from Manuel Lemos
I want to understand how this data retriving works.

In the documentation (forms.html), there is an example:
$checked=$my_form_object->GetCheckedState($input)

I don't really understand the $input argument. I had tried putting the $input, as in the example above,and also the "NAME" or the "ID" of my fields, but I could not print out the validated value.

Here were what I did.

In the section of (indicated in test_form.php example):
if($doit)
{
$form->ReadOnly=1;
}

Instead of putting $form->ReadOnly=1;


I put in: (for a name field)
$value=$form->GetInputValue('user_name');
print $value;

I put in: (for checkbox field)
$checked=$form->GetCheckedState('operation_type')
print $checked;

I was not able to print out these validated values.

Please kindly explain further on retreving the these validated values.
Thanks
Ben

  13. Re: Get start to use   Reply   Report abuse  
Picture of Wah Y Lam Wah Y Lam - 2007-10-02 14:30:49 - In reply to message 11 from Manuel Lemos
I would like to learn how to retreive the validate values. In your forms.html I found the example:

$checked=$my_form_object->GetCheckedState($input)

Can you please explain further the $input argument?
I tried using $input, "NAME" or "ID" of my fields and they did not retrieve the validated results.

What I did:

In the portion of (similar in test_form.php example):
if($doit)
{
$form->ReadOnly=1;
}

I put in: (for a checkbox field)
if($doit)
{
$checked=$form->GetCheckedState('Operation_Type')
print $checked;
}

and also:

I put in: (for a name field)
if($doit)
{
$value=$form->GetInputValue('user_name');
print $value;
}

The 'Operation_Type', and 'user_name' are the "NAME" of my fields. It did not print out my validated input values!

Please Help! Thanks!
Ben

 
  1 - 10   11 - 13