Jump to content

Q about a function.


oldschr

Recommended Posts

This Function works perfectly in PHP 4, but with 5 it is throwing back errors.  If you need the whole code let me know.

 

The <?PHP and /php?>  are just for you to see I am using PHP, I only use <? and ?>

 

Here is the function call

 

      $postarray = makemyarray($HTTP_POST_VARS);

 

<?PHP

function makemyarray($form_vars)

{

  foreach ($form_vars as $key => $value)

      {

        if ($key == "pagecount"){}

        elseif ($key == "password"){}

        elseif ($key == "name")

        {

            $blankfield["userid"] = strtolower($value);

        }

        elseif ($key == "Count"){}

        else

        {

            $blankfield["$key"] = $value;

        }

       

      }

  return $blankfield;

}

/PHP?>

Link to comment
Share on other sites

I guess that would of helped....sorry.  Also I did try to use the CODE function.

 

Warning: Invalid argument supplied for foreach() in ../htdocs/cahs/eval/faculty05.php on line 39

 

Warning: Invalid argument supplied for foreach() in ../htdocs/cahs/eval/faculty05.php on line 526

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.