current page url

Need some custom code changes to the phpBB core simple enough that you feel doesn't require an extension? Then post your request here so that community members can provide some assistance.

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Post Reply
Nick225
Registered User
Posts: 131
Joined: Sat Nov 24, 2018 7:48 pm

current page url

Post by Nick225 »

I was using

Code: Select all

$PHP_SELF
in good'old phpbb2. But it turned out that was great for hackers.
Now I am phpbb3 and need pick up the current page link while not in the template file. All the examples I have seen so far are done withing template *.tpl file.
Is there a way to get the current external page link the way PHP_SELF was providing it?

PATHINFO_FILENAME also failing because super_globals() is disabled.
User avatar
AmigoJack
Registered User
Posts: 6108
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン
Contact:

Re: current page url

Post by AmigoJack »

Why not getting familiar with PHP first? http://php.net/manual/en/reserved.variables.server.php
  • "The problem is probably not my English but you do not want to understand correctly. ... We will not come anybody anyway, nevertheless, it's best to shit this." Affin, 2018-11-20
  • "But this shit is not here for you. You can follow with your. Maybe the question, instead, was for you, who know, so you shoved us how you are." axe70, 2020-10-10
  • "My reaction is not to everyone, especially to you." Raptiye, 2021-02-28
Nick225
Registered User
Posts: 131
Joined: Sat Nov 24, 2018 7:48 pm

Re: current page url

Post by Nick225 »

AmigoJack wrote: Sun Dec 09, 2018 9:38 am Why not getting familiar with PHP first? http://php.net/manual/en/reserved.variables.server.php
Thanks. I've tried to use 'SCRIPT_NAME'
$thisFinename = $_SERVER['SCRIPT_NAME'];
but got the same error.
"Illegal use of $_SERVER. You must use the request class to access input data........"
User avatar
canonknipser
Registered User
Posts: 2096
Joined: Thu Sep 08, 2011 4:16 am
Location: Germany
Name: Frank Jakobs
Contact:

Re: current page url

Post by canonknipser »

Nick225 wrote: Sun Dec 09, 2018 3:52 pm Illegal use of $_SERVER. You must use the request class to access input data........
That is a message generated by phpBB. So you are inside the phpBB environment and should follow the general coding guideline, esp. the chapter about the request class, as stated in the error message: https://area51.phpbb.com/docs/32x/codin ... ml#general
Greetings, Frank
phpbb.de support team member
English is not my native language - no support via PM or mail
New arrival - Extensions and scripts for phpBB
Post Reply

Return to “phpBB Custom Coding”