scope problem using functions and require_once

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Below is a code snippet I am having a hard time with.  I rerquire code1.php
and code 2.php.

code1.php contains some variables the code needs.
code2.php contains some functions I call from the function below,

Line 4 "echo" below corrctly shows the var_name from code1.php.  BUT, when I
call it again at the end of the snippet below, it shows nothing.

I even added another reference to code1.php in that function and it did not

Why and what do I do about it?

Many thanks in advance!



echo "name = ".var_name;

    $error = look_at_data($_POST);       //**********
    if ($error == "") {
        $success = "User inserted successfully";

function look_at_data($form23_data) {   //**********
        echo "name = ".var_name;

Site Timeline