PHP on WAMP SERVER - Errors at PHP script -
i have wamp server on windows 7.
i have php code :
<html> <head> <script> var myvar; <?php include "myotherphp.php" ?> <!-- put single line, myvar="error"; or myvar="ok"; --> </script> <body> ... <script> if (myvar === "error") { ... ... } </script> <body>
and code myotherphp.php calculation , ...
<?php ... echo 'myvar="error"; ?>
myotherphp.php has tousand of lines code, but... when did, before on iis - there no problem, , didn't exception, annoying code inserted automatically on code:
scream: error suppression ignored notice: undefined index: ...
it unwanted code. 1. there option not putting code (it more annoying, , makes other errors on script, because due code, html isn't compiled properly. 2. want put here whole code (tousand of lines, including other php) , need concept compile code properly.
i found phplint http://www.icosaedro.it/phplint/phplint-on-line.html, don't know whether apache, , not online phplint. since line like:
required_once __dir__ . "/mythirdphp.php";
will never compiled (due security issue). not jslint.com (which on opinion better , understoodable. put tousands of lines on javascript, , managed semi-compiled them no error or warnings on jslint ...)
i need understand issue of lint , buggy code, , appriciated. need crossed platform compiled.
if there other tools - let me know about.
thanks :)
undefined index errors result of bad php code (just example, not complete list of possible causes)
$x = $_post['some_variable']
but 'some_variable' optional , in case has not been passed script in post array.
the proper solution correct code testing if variable exists before using it.
$x = array_key_exists('some_variable'] ? $_post['some_variable'] : '';
alternatively if have 1000's of lines of code fix, turn error reporting off adding
error_reporting(0);
to top of script bad code in. dirty solution may option.
Comments
Post a Comment