Undefined index: HTTP_PREFER

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
c_kid
Posts: 2
Joined: Thu Sep 04, 2003 1:32 am

Undefined index: HTTP_PREFER

Post by c_kid »

Hy,

i have a problem with cacti 0.8.3a. I get after the first login with user: admin, pwd: admin the following message:

Notice: Undefined index: HTTP_PREFER in /srv/www/htdocs/cacti/auth_login.php
on line 124

Warning: Cannot modify header information - headers already sent by (output
started at /srv/www/htdocs/cacti/auth_login.php:124) in
/srv/www/htdocs/cacti/auth_login.php on line 124

I use the following system:
Mysql 3.23.55
MyODBC 3.23.55
Apache 1.3 with mod_php4

What s wrong? :-?
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Post by raX »

Can you show me what line 124 of auth_login.php looks like for you? Mine reads:

Code: Select all

header("Location: " . $_SERVER["HTTP_REFERER"]); break;
-Ian
c_kid
Posts: 2
Joined: Thu Sep 04, 2003 1:32 am

HTTP_REFERER

Post by c_kid »

Hy, this is the syntax at Line 120


/* ok, at the point the user has been sucessfully authenticated; so we must
decide what to do next */
switch ($user["login_opts"]) {
case '1': /* referer */
header("Location: " . $_SERVER["HTTP_REFERER"]); break;
case '2': /* default console page */
header("Location: index.php"); break;
case '3': /* default graph page */
header("Location: graph_view.php"); break;
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Re: HTTP_REFERER

Post by raX »

c_kid wrote:Notice: Undefined index: HTTP_PREFER in /srv/www/htdocs/cacti/auth_login.php on line 124
c_kid wrote:header("Location: " . $_SERVER["HTTP_REFERER"]);
If I compare your error message and the cooresponding line of code, it does not match up. Your error complains about a missing 'HTTP_PREFER', but the code clearly reads 'HTTP_REFERER'. Are you sure there is not a typo somewhere? Perhaps this is the problem.

-Ian
thEam

Post by thEam »

Hiho!

I am getting the same error, except it says

Notice: Undefined index: HTTP_REFERER in /var/www/cacti/auth_login.php on line 78

Warning: Cannot modify header information - headers already sent by (output started at /var/www/cacti/auth_login.php:78) in /var/www/cacti/auth_login.php on line 78

for me.

Line78 from auth_login.php looks like this:
header("Location: " . $_SERVER["HTTP_REFERER"]); break;

I'm using cacti 0.8.4, mysql Ver 12.22 Distrib 4.0.16, php 4.3.1 and Apache 2.0.44. php4-snmp is installed.

Any help would be appreciated.

thEam
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Post by raX »

Do you have the output of phpinfo() handy? If so, scroll down to the "PHP Variables" section. Do you see a row titled '_SERVER["HTTP_REFERER"]'?

-Ian
thEam

Post by thEam »

I just called phpinfo() from a different file, right after trying to login. There was no PHP-Variable called _SERVER["HTTP_REFERER"]...
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Post by raX »

For those of you getting the error on line 78 of auth_login.php under Cacti 0.8.4, try out this patched file:

http://www.raxnet.net/downloads/patches ... in.php.txt

Let me know how it works.

-Ian
ServerJordy

Post by ServerJordy »

after patch I get:

Notice: Undefined index: HTTP_REFERER in include/auth.php on line 38
ServerJordy

Post by ServerJordy »

In include/config.php I added:

$_SERVER["HTTP_REFERER"]=$_SERVER["SCRIPT_URI"];

Then it works.
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Post by raX »

I will do my best to remove all references to $_SERVER["HTTP_REFERER"] throughout the code for version 0.8.5. This should eliminate any problems related to this that you are having.

-Ian
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest