The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Undefined Variables on Page
#1
Hello!

I have 6 pages that have public access in my system:
Code:
usersc/includes/external/phoneadd.php
Code:
usersc/includes/external/phoneedit.php
Code:
usersc/includes/external/templateadd.php
Code:
usersc/includes/external/templateedit.php
Code:
usersc/includes/external/zipadd.php
Code:
usersc/includes/external/zipedit.php

These pages are accessed via
Code:
usersc/externalpublic.php
using
Code:
?type
in the URL and defined accordingly. However, when a "guest" (non-logged in user) visits the pages, the page works just fine, but in the header we have these errors:
Notice: Trying to get property of non-object in /home/aircentralized/public_html/boss/usersc/externalpublic.php on line 27

Notice: Undefined variable: column in /home/aircentralized/public_html/boss/users/helpers/us_helpers.php on line 111

Notice: Undefined variable: data in /home/aircentralized/public_html/boss/users/helpers/us_helpers.php on line 111

I have removed the navigation from the files as I do not want the public having access to the navigation. These pages are linked separately from my system.

Any thoughts on how to cure these errors? Let me know if you need some code and what.
  Reply
#2
Note: When a logged in user visits these pages, the errors disappear.
  Reply
#3
It sounds like you are running queries on those pages that require a logged in user. They are probably looking for the user id.

Wrap those queries in

Code:
if ($user->isLoggedIn()) {
Code:
//queries go here
Code:
}
  Reply
#4
You're smart...like really smart! LOL. I just removed the get user info from my externalpublic.php page. Thanks!
  Reply
#5
haha. Awesome. Glad it worked!
  Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)