Undefined index PHP error: remember_user

Helpdesk for my helpdesk software

Moderator: mkoch227

Post Reply
MacJoyful
Posts: 17
Joined: Wed Sep 02, 2009 9:58 pm

Undefined index PHP error: remember_user

Post by MacJoyful »

Script URL:
Version of script:2.1
Hosting company: U of M academic department - I'm the sys admin

URL of phpinfo.php: http://slc-admin3.scilabs.lsa.umich.edu ... myinfo.php

URL of session_test.php:
http://slc-admin3.scilabs.lsa.umich.edu ... n_test.php

What terms did you try when SEARCHING for a solution:
in forum: undefined index php error remember_user
Google: undefined index php error
Write your message below:
Undefined index: remember_user in /hesk/admin/index.php on line 137
Found this by googling:
So is a $_POST or another variable not defined correctly?

Here's the portion of the code that's being complained about:

Code: Select all

	/* Remember username? */
	if ($hesk_settings['autologin'] && $_POST['remember_user']=='AUTOLOGIN')
	{
		setcookie('hesk_username', "$user", strtotime('+1 year'));
		setcookie('hesk_p', "$pass_enc", strtotime('+1 year'));
	}
	elseif ($_POST['remember_user']=='JUSTUSER')
	{
		setcookie('hesk_username', "$user", strtotime('+1 year'));
		setcookie('hesk_p', '');
	}
	else
	{
		// Expire cookie if set otherwise
		setcookie('hesk_username', '');
		setcookie('hesk_p', '');
	}
Klemen
Site Admin
Posts: 10142
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

Hello,

These are just PHP notices, they are tuned off on most servers (and should be off on live servers). If you have Debug mode disabled these will never show to the third party visitors. HESK will still work completely normally.

To avoid them from being logged into the error log you can try adding

Code: Select all

error_reporting(E_ALL ^ E_NOTICE);
just below

Code: Select all

require(HESK_PATH . 'hesk_settings.inc.php');
in the admin/index.php file.


Alternatively you check inputs with isset first. In admin/index.php add this line of code

Code: Select all

if (!isset($_REQUEST['a'])) {$_REQUEST['a']='';} 
above line 47

Code: Select all

switch ($_REQUEST['a']) 
and this code

Code: Select all

if (!isset($_POST['remember_user'])) {$_POST['remember_user'] = false;}
below

Code: Select all

/* Remember username? */
In any way these functions will still be working properly and I do advise you to turn PHP notices off or you might get similar reports with many PHP scripts.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
MacJoyful
Posts: 17
Joined: Wed Sep 02, 2009 9:58 pm

Error Reporting

Post by MacJoyful »

The server this is running on is not a production server although we are using a couple web apps in out day-to-day work. Basically we are trying them out to see how well or if they fit our work model.

Anyway is there a way to log critical errors vs. verbose. I did make some changes to the php.ini file which were intended to address these sorts of non-critical reports being logged. However, this apparently needs some fine tuning on my part. I will take a look at the php manual to try to get a better handle on the error reporting function of php.

This is a learning process. I am not a programmer by trade but of necessity. I have grown weary of spending thousands of dollars on commercial software and required maintenance contracts that really don't meet our needs or fit our work model.

I am using MRBS for room scheduling and possibly Hesk for help request tracking. The downside of using open source software is the need to quickly gain programming skills to better implement these solutions. However, the converse of this is that one gains skills which improve one's marketability which is never a bad thing.

So far my coworkers seem to like the tracking system. We look forward to a method for assigning requests.

Thank you for sharing and maintaining this script. It's pretty nifty.
Klemen
Site Admin
Posts: 10142
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

Try setting error_reporting in your php.ini file to

Code: Select all

error_reporting = E_ALL & ~E_NOTICE
That should do the trick.

Regards,
Klemen
Post Reply