rick Hanzlik - 2013-01-04

I created a form using form generator on one of my web sites. I seemed to work just fine on the original site. I then moved all the code and folder to my godaddy site and the form no longer works.

The database information id OK
original site used PHP version 5.2.17 and apache version 2.0.64
the new sire uses PHP version 5.3 and apache version2.0 (i think)
the problem seems to be in the pt_register code:

<?php

function pt_register()
{
   
   
  $num_args = func_num_args();
  
   $vars = array();
   if ($num_args >= 2) {
      
       $method = strtoupper(func_get_arg(0));

       if (($method != 'SESSION') && ($method != 'GET') && ($method != 'POST') && ($method != 'SERVER') && ($method != 'COOKIE') && ($method != 'ENV')) {
           die('The first argument of pt_register must be one of the following: GET, POST, SESSION, SERVER, COOKIE, or ENV');
     }

       $varname = "\$_{$method}";
  
      global ${$varname};

       for ($i = 1; $i < $num_args; $i++) {
        
           $parameter = func_get_arg($i);
           echo "  0000 " . $varname;   <<< added for debugging
  echo "  1111 " . $parameter;           <<< added for debugging
  echo "  22222  " . ${$varname}; <<< added for debugging  this line gets printed but the ${$varname} is empty.
 
           if (isset(${$varname})) {   <<<<<<< this test fails
              
               global $$parameter;
               $$parameter = ${$varname};
              echo "?????  ",$$parameter;     <<<<<<<< added for debugging, this never gets printed
          }

       }

   } else {
       die('You must specify at least two arguments');
   }

}

I have added echo statements in the process.php file to insure that the field information is recieved and that part is ] working fine. I am a little confused about the construct ${variable} I think it is an array of arrays but It doesn't seem to be working Perhaps it is an issue with PHP 5.3 or perhaps my ISP has something blocked.

Any help or suggestions would be welcomed.