Googled for hours and can't find an answer😕
I get a "Notice: Undefined offset: 1" warning referring to line 2 in the the code below:
/
* add domain name to username if whatnot and soforth */
if (!list($login_host, $other) = split(':', $_SERVER['HTTP_HOST'])) {
$login_host = $_SERVER['HTTP_HOST'];
}
if (!strstr($login_username, '@')) {
/* strip any leading 'www.' so that only a username is required */
$login_host = preg_replace('/^www\./i', '', $login_host);
$login_host = preg_replace('/^webmail\./i', '', $login_host);
$login_host = preg_replace('/^mail\./i', '', $login_host);
$login_username .= '@' . $login_host;
}
I did not write the code, just trying to stop the warning. This code snippet is from a webmail redirect page which prevents users from reposting their form data after a successful logout.
I'm sure the fix is is to add "isset" somewhere, but I can't figure it out.
Can someone help?