Form Handling

Posted by Lachhekumar Nadar on 2009-07-07 00:35:57

The variable are made global in the koolphp, you are not required to use $_GET, $_POST to access the value of the submited form. The form value are automatically processed and re initalized again when the forms are displayed

You can get more information on the form configuration and other attribute from Variable & replace Pattern > Forms & Components

PHP Code
<?
    
/**
    Sample code to access the value
    */
    
    // checking with the submit button
    
    
if($Submit != "")
    {
        
// Accessing the file variable
        
if(!valid::string($file))            {    $error 1; }
        
        
// Accessing the string varaible
        
if(!valid::string($firstname))        {    $error 1; }
        
        
// Accessing the string varaible
        
if(!valid::string($lastname))        {    $error 1; }
        
        
// Accessing the textrea field
        
if(!valid::string($address))        {    $error 1; }
        
        
// Accessing the password field
        
if(!valid::string($password))        {    $error 1; }
        
        
// Accessing the EDITOR Field
        
if(!valid::string($description))    {    $error 1; }
        
        
// Accessing the single select combo
        
if(!valid::string($access))            {    $error 1; }
        
        
// Accessing the multiple sleect select combo
        
if(!is_array($usersrights))            {    $error 1; }
        
        
// Accessing the checkbox value
        
if(!valid::string($terms))            {    $error 1; }
        
        
// Accessing the radio value
        
if(!valid::string($gender))            {    $error 1; }
    } 
?>

The file uploading, the file uploading is done automatically by the koolphp and the file name is set in the form varaible.

Warning: You cannot make the  file type as an array