Title: Error with HTTP_REFERER due to bad coding + solution
Last modified: October 18, 2016

---

# Error with HTTP_REFERER due to bad coding + solution

 *  [c2cero](https://wordpress.org/support/users/c2cero/)
 * (@c2cero)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/error-with-http_refere-due-to-bad-coding-solution/)
 * My log is full of errors like this:
 * [17-Oct-2016 22:17:51 UTC] PHP Notice: Undefined index: HTTP_REFERER in /home/
   c2cero/public_html/wp-content/plugins/w3-total-cache/DbCache_WpdbInjection_QueryCaching.
   php on line 366
 * This is because you don’t check if $_SERVER[‘HTTP_REFERER’] is set which is not
   always the case (its optional, depends on the client).
 * Therefore, line 366 must be:
 * if(isset($_SERVER[‘HTTP_REFERER’])) {
    if ( strpos( $_SERVER[‘HTTP_REFERER’],‘/
   wp-admin/’ ) === false ) { $ajax_skip = true; } }
 * The same bad coding is also presente in other parts of the code. So please fix
   that!
    -  This topic was modified 9 years, 7 months ago by [c2cero](https://wordpress.org/support/users/c2cero/).
    -  This topic was modified 9 years, 7 months ago by [c2cero](https://wordpress.org/support/users/c2cero/).

The topic ‘Error with HTTP_REFERER due to bad coding + solution’ is closed to new
replies.

 * ![](https://ps.w.org/w3-total-cache/assets/icon-256x256.png?rev=1041806)
 * [W3 Total Cache](https://wordpress.org/plugins/w3-total-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/w3-total-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/w3-total-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/w3-total-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/w3-total-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/w3-total-cache/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [c2cero](https://wordpress.org/support/users/c2cero/)
 * Last activity: [9 years, 7 months ago](https://wordpress.org/support/topic/error-with-http_refere-due-to-bad-coding-solution/)
 * Status: not resolved