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 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?

By Dave - June 22, 2017

Hi Kittybiccy,

Yea so that variable is being used on /rooms.php somewhere.  I'm not sure what it's being used for so I can't be sure.  But if you want to hide a PHP error you can do that by adding a @ in front of it, eg: @$_SERVER['HTTP_USER_AGENT'] 

There might be some custom code on that page that tries to detect the users browser.  Likely it will just show an error to end users if you don't hide it.  You'd have to take a look to know for sure.  It's likely not a big issue at all.

Dave Edis - Senior Developer
interactivetools.com