Php errors

4 posts by 2 authors in: Forums > CMS Builder
Last Post: June 22, 2017   (RSS)

By Kittybiccy - June 21, 2017

I've just received an email saying there is a php error on one of our client sites:

Undefined index: HTTP_USER_AGENT

Please could soemone explain what this means (in simple terms!)? Thanks!

By Dave - June 21, 2017

Hi Kittybiccy, 

Is the error in the CMS or on one of the frontend pages? 

"Undefine Index" means PHP tried to get a value from an array and it wasn't there.  Usually $_SERVER['HTTP_USER_AGENT'] is set to the name of the users browser.  Usually something like the following.  Your browser sends that with every page request to identify which kind of browser it is.

Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36

So either the CMS, or a CMS plugin, or one of your frontend pages is trying to access $_SERVER['HTTP_USER_AGENT'] and it's not defined.  Maybe because someone's browser isn't sending it or because a script is being run from the server shell such as from a cron job.  

You need to figure out which page it's on to further isolate the problem.

Dave Edis - Senior Developer

interactivetools.com

By Kittybiccy - June 22, 2017

Hi Dave,

The error is in the CMS error log and one certain page. This was the full error:
Jun 21st, 2017 - 06:30:35 AM
E_NOTICE: Undefined index: HTTP_USER_AGENT
/home/linweb44/a/ariaraisland.com-1089953466/user/htdocs/rooms.php (line 188)
http://www.ariaraisland.com/rooms.php

I just want to check that it's not going to cause any issues for the client at all?