Welcome to Geeklog, Anonymous Friday, March 29 2024 @ 06:50 am EDT

Geeklog Forums

$HTTP_SERVER_VARS['PHP_SELF'])


Status: offline

LWC

Forum User
Full Member
Registered: 02/19/04
Posts: 818
I don't know why admin/mail.php (i.e. "Mail Users") keeps hunting me...

Anyway, first of all thanks for giving me credit for some of its fixes.

Of course, when I upgraded to 13.9.10rc1, the first thing I wanted was to check the new mail.php...only to discover there's a new problem.

See, my site is in the form of:
http://user.domain.com/user

I noticed the template's form's action field uses {php_self}.

The result?
<form action="in/user/admin.php"...

I'm not sure if the "in" is from the domin (i.e. the last two letters of my domain, but no ".com"), but in any case of course this doesn't work and I can't send messages.

Even if you think it's a specific problem for me and I'll have to change it manually to, say, {site_url}/admin/mail.php, how come it worked in previous versions?
 Quote

Status: Banned

machinari

Forum User
Full Member
Registered: 03/22/04
Posts: 1512
$PHP_SELF was used in 1.3.9

1.3.10 is using $HTTP_SERVER_VARS['PHP_SELF']

maybe try switching back and see if that fixes it. don't forget to swith the global.
 Quote

Status: offline

LWC

Forum User
Full Member
Registered: 02/19/04
Posts: 818
Ok, get this.
I didn't understand how exactly to "switch the global" so I just wrote $PHP_SELF and went ahead.

The result?
[quote
<form action=""...>
[/quote]
(i.e. empty...)

But nonetheless, it worked!

P.S.
It finally looked like
user <email>
AND
changeable admin user & email!

So give me one good reason to load an extra value over just using an empty value.

In other words, I think you should leave it as an empty value and avoid all the problems.

What do you think?
 Quote

Status: Banned

machinari

Forum User
Full Member
Registered: 03/22/04
Posts: 1512
making the changes in the template file isn't going to fix anything and will just, as you have realized, introduced a null variable into your template file.

the changes i was refering to were to be made in the php code found in the admin/mail.php file--specifically, the function displayform(). sorry for the miscommunication.
 Quote

Status: offline

LWC

Forum User
Full Member
Registered: 02/19/04
Posts: 818
I was talking about the function displayform() inside admin/mail.php...

I changed

$mail_templates->set_var ('php_self', $HTTP_SERVER_VARS['PHP_SELF']);

into

$mail_templates->set_var ('php_self', $PHP_SELF);

and since it turned out to be empty anyway, I ended it up as

$mail_templates->set_var ('php_self', '');
 Quote

Status: Banned

machinari

Forum User
Full Member
Registered: 03/22/04
Posts: 1512
Quote by LWC: I was talking about the function displayform() inside admin/mail.php...
good, we're on the same page then... the first line after the function begins reads:
Text Formatted Code
    global $_CONF, $_TABLES, $_USER, $LANG31, $HTTP_SERVER_VARS;

 
change that to reflect your variable change, ie:
Text Formatted Code
    global $_CONF, $_USER, $_LANG31, $PHP_SELF, $LANG31, $_TABLES;

 
now your variable wont be empty. however it may end you up at the same place where you started in which case that isn't the problem.
 Quote

Status: offline

LWC

Forum User
Full Member
Registered: 02/19/04
Posts: 818
Yea, it works, but it gives the same results if the "action" field is just empty.

So why bother loading one more parameter?
 Quote

Status: Banned

machinari

Forum User
Full Member
Registered: 03/22/04
Posts: 1512
it provides consistancy across different operating environments. where it may not be useful in one environment, it is necessary in another.
but it seems strange that a form will post where there is no action defined.
oh well, glad it works for you.
 Quote

Status: offline

LWC

Forum User
Full Member
Registered: 02/19/04
Posts: 818
Well, in any case, I think this proves it was a mistake to use "$HTTP_SERVER_VARS['PHP_SELF']".

I wouldn't like it if I had to manually change it from now on each time I upgrade...

And if it doesn't work for me, it probably doesn't work for others too.

I shall change this topic's subject and hope others react and say if it fails for them too.
 Quote

All times are EDT. The time is now 06:50 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content