Hi, I', trying to build & process a form with an object, but i have now a problem. The submited values doesn´t are reaching the values inside the object to be processed. 😕
Any help will be welcome
Here is an example code:
<?php
//--------Object Definition
class object1 {
function processform(){
print "Here is the result into the object ->[$submit]<br>\n";
}
function printform(){
print "<html>\n";
print "<body>\n";
print "<form action=\"$PHP_SELF\" method=\"post\" name=\"form1\" target=\"_self\">\n";
print "<input name=\"submit\" type=\"submit\" value=\"should be printed out\">\n";
print "</form>\n";
print "</body>\n";
print "</html>\n";
}
}
//---------------------------------------------------------------------------------
$obj1= new object1(); // Create object
if (isset($submit)){ // -------------------------------------------- Check value to process the form
print "Here is the result out of the object ->[$submit]<br>\n";
$obj1->processform();
exit;
}
$obj1->printform() //------------------------------------------------ Printout the form
?>
And the results are:
Here is the result out of the object ->[should be printed out]
Here is the result into the object ->[]
Thanks for your help
Carlos