Jump to content

nscherneck

Members
  • Posts

    1
  • Joined

  • Last visited

Posts posted by nscherneck

  1. PHP beginner here. I have the following in index.php (the two files live in the same directory)...

    <?php require_once( dirname( __FILE__ ) . '/functions.php' ); ?>
    <!DOCTYPE html>
    <html lang="en">
      <head>
        <title><?php echo $nds; ?></title>
      </head>
      <body>
      </body>
    
    </html>
    
    

    ...and here is the required PHP file (functions.php)...

    <? php
    
    // test variable
    $nds = 'Test title.';
    
    ?>
    

    This gives me an "undefined variable" error when tested in a browser. Is this an issue of scope?

     

×
×
  • Create New...