Jump to content

Error Reporting Crisis


nitation

Recommended Posts

Good day,

 

I am receiving a notice when i turn on my error reporting. I don't know what to do!

Here is my code

<?php
error_reporting(E_ALL);
ini_set('display_errors', 'on');

include_once 'includes/en.php';
include_once 'includes/config.php'; 

ob_start();
if (isset($_POST['log'])) {
$username=$_POST['username']; // This is line 10

 

This is the notice i encounter:

Notice: Undefined index: username in C:\Program Files\xampp\htdocs\myfiles\admin\login.php on line 10

 

Link to comment
https://forums.phpfreaks.com/topic/137016-error-reporting-crisis/
Share on other sites

If you're running that for the first time it's because a submit button with a form hasn't been used - it isn't anything to worry about.

 

It's just a notice to let you know.

 

If I turned on full error reporting on my website I'd get quite a few notices like that.

 

If you made a form and had a field called "username" the notice should go away when you submit the form.

 

Hope I've explained that properly! :D

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.