• Jetzt anmelden. Es dauert nur 2 Minuten und ist kostenlos!

Reihenweise Fehler

Witschi262

Blogger
Ich arbeite mit Xampp und habe bevor überhaupt was ausgegeben wird werden erstmal tausende Fehler ausgegeben. Als kleines Beispiel:

PHP:
Notice: Use of undefined constant config - assumed 'config' in C:\xampp\htdocs\Zabboweb.php on line 54

Notice: Use of undefined constant sitepath - assumed 'sitepath' in C:\xampp\htdocs\index.php on line 14

Notice: Use of undefined constant config - assumed 'config' in C:\xampp\htdocs\Zabboweb.php on line 54

Notice: Use of undefined constant imgpath - assumed 'imgpath' in C:\xampp\htdocs\index.php on line 15

Notice: Use of undefined constant config - assumed 'config' in C:\xampp\htdocs\Zabboweb.php on line 54

Notice: Use of undefined constant dcrs - assumed 'dcrs' in C:\xampp\htdocs\index.php on line 18

Notice: Use of undefined constant config - assumed 'config' in C:\xampp\htdocs\Zabboweb.php on line 54

Notice: Use of undefined constant texts - assumed 'texts' in C:\xampp\htdocs\index.php on line 19

Notice: Use of undefined constant config - assumed 'config' in C:\xampp\htdocs\Zabboweb.php on line 54
Das nur noch ca. 30 mal

Weiter unten kommen reihenweise diese Fehler
PHP:
Notice: Use of undefined constant edit - assumed 'edit' in C:\xampp\htdocs\incl\full.php on line 405
Add Box 
Notice: Use of undefined constant edit - assumed 'edit' in C:\xampp\htdocs\incl\full.php on line 411

Notice: Use of undefined constant edit - assumed 'edit' in C:\xampp\htdocs\incl\full.php on line 415
 
NOTICE: USE OF UNDEFINED CONSTANT EDIT - ASSUMED 'EDIT' IN C:\XAMPP\HTDOCS\INCL\FULL.PHP ON LINE 417


NOTICE: USE OF UNDEFINED CONSTANT EDIT - ASSUMED 'EDIT' IN C:\XAMPP\HTDOCS\INCL\FULL.PHP ON LINE 417




Notice: Use of undefined constant edit - assumed 'edit' in C:\xampp\htdocs\incl\full.php on line 411

Notice: Use of undefined constant edit - assumed 'edit' in C:\xampp\htdocs\incl\full.php on line 415
 
NOTICE: USE OF UNDEFINED CONSTANT EDIT - ASSUMED 'EDIT' IN C:\XAMPP\HTDOCS\INCL\FULL.PHP ON LINE 417


NOTICE: USE OF UNDEFINED CONSTANT EDIT - ASSUMED 'EDIT' IN C:\XAMPP\HTDOCS\INCL\FULL.PHP ON LINE 417




Notice: Use of undefined constant edit - assumed 'edit' in C:\xampp\htdocs\incl\full.php on line 411

Notice: Use of undefined constant edit - assumed 'edit' in C:\xampp\htdocs\incl\full.php on line 415
 
NOTICE: USE OF UNDEFINED CONSTANT EDIT - ASSUMED 'EDIT' IN C:\XAMPP\HTDOCS\INCL\FULL.PHP ON LINE 417


NOTICE: USE OF UNDEFINED CONSTANT EDIT - ASSUMED 'EDIT' IN C:\XAMPP\HTDOCS\INCL\FULL.PHP ON LINE 417




Notice: Use of undefined constant edit - assumed 'edit' in C:\xampp\htdocs\incl\full.php on line 411

Notice: Use of undefined constant edit - assumed 'edit' in C:\xampp\htdocs\incl\full.php on line 415
 
NOTICE: USE OF UNDEFINED CONSTANT EDIT - ASSUMED 'EDIT' IN C:\XAMPP\HTDOCS\INCL\FULL.PHP ON LINE 417


NOTICE: USE OF UNDEFINED CONSTANT EDIT - ASSUMED 'EDIT' IN C:\XAMPP\HTDOCS\INCL\FULL.PHP ON LINE 417




Notice: Use of undefined constant edit - assumed 'edit' in C:\xampp\htdocs\incl\full.php on line 443
Add Box 
Notice: Use of undefined constant edit - assumed 'edit' in C:\xampp\htdocs\incl\full.php on line 449

Notice: Use of undefined constant edit - assumed 'edit' in C:\xampp\htdocs\incl\full.php on line 453

Das ist doch nicht normal.Allerdings ist es auch bei anderen CMS's und Scripts so. Kann ich das evtl. unterbinden´?
 
Da scheint jemand seine Strings nicht in Anführungszeichen zu setzen.

PHP:
$config[edit] = 'foo'; // falsch
$config['edit'] = 'foo'; // richtig
 
oder vergessen zu haben, bei Variablen das $-Zeichen an den Anfang zu setzen
PHP:
$a = config . edit
statt
PHP:
$a = $config . $edit
Fehler sollte man nicht unterdrücken, sondern beheben, wenn man Wert auf das gewünschte Ergebnis legt. Sonst kann man natürlich Error-Reporting ganz deaktivieren :mrgreen:
 
Uff, bei anderen klappt das aber hervorragend. Naja, das Script ist etwas Älter, hat man in älteren PHP Versionen das evtl. noch nicht gehabt? Ich habe mir mal kurz die $_POST Übertragungen angeschaut. Das ist mir schon aufgefallen dass dort ' fehlen.
 
Ja, das sieht man öfter mal bei alten Scripts. Damals waren solche Dinge einfach noch nicht so sehr im Bewusstsein, nehme ich an. Je weiter PHP entwickelt wird und je mehr Leute die Sprache verwenden, desto mehr wird auf möglichst fehlerfreien Code geachtet.

Wenn du das Script nicht unbedingt brauchst, schmeiß es weg und/oder schreib es neu oder um.

Na ja, das heißt, wenn es eine größere Sache ist, ist umschreiben immer doof. Vielleicht hat der Entwickler eine neue Version?
 
Falls dir das dann doch zu mühsam ist, kannst du auch am Anfang der Scripts Folgendes eingeben:
PHP:
error_reporting(0);

Allerdings ist das (bad practice)²
 
Zurück
Oben