Jump to content

Search the Community

Showing results for tags 'undefined variable'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start





Website URL








Found 2 results

  1. iwato

    Undefined Variable

    GREETING: Happy New Year, W3Schools! I am looking forward to another year of online progress. Hopefully many of the problems that I have been experiencing for the last year and a half will disappear with the addition of a brand new iMac that can handle the latest PHP and MySql software. This said, I remain the advanced novice that I am and very much hope that you will continue to stand by my side. BACKGROUND: Please find below a set of code that permits one new set of functionality, but destroys another. The related error messages are provided beneath the code. if (isset($_GET['refer_type']) && filter_var($_GET['refer_type'], FILTER_VALIDATE_INT)) { $refer_type = $_GET['refer_type']; } else { $refer_type = 0; } if (isset($_GET['panel_type']) && filter_var($_GET['panel_type'], FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH)) { $panel_type = $_GET['panel_type']; if (isset($_GET['lang_type']) && filter_var($_GET['lang_type'], FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH)) { $lang_type = $_GET['lang_type']; } } else { $panel_type = 0; } ERROR MESSAGES: [05-Jan-2020 04:10:40 UTC] PHP Notice: Undefined variable: lang_type in /home/thege0/public_html/grammarcaptive.com/devcptv18rs/overview.html on line 99 QUESTION: Can you see anything in the code line if (isset($_GET['lang_type']) && filter_var($_GET['lang_type'], FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH)) { $lang_type = $_GET['lang_type']; } or elsewhere that could be triggering the error. The code line just given is new and is clearly the initial, but maybe not the final source of the problem. By the way, when the code was first introduced, it did not appear to create a problem. Only several days later did the problem appear. Roddy
  2. 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...