IP in registration form

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
User avatar
fastreplies
I've Been Banned!
Posts: 372
Joined: Wed Dec 26, 2007 7:08 am

Re: IP in registration form

Post by fastreplies »

stevemaury wrote: Mon Mar 12, 2018 1:35 pmNot kidding. Not crazy
LOL, never call you crazy. But you know best.
Just kidding. :lol:

Anyway, who would ever guess that simple question:
$ip=$_SERVER['REMOTE_ADDR']
where should I place it to shine to visitors their IP in registration form,
would take 2 days and 3 pages with totally useless arguments, cause I still didn't
get an answer to subject of my original post, which I definitely care to learn.

So, if any participants would like to take a shot and answer OP question, please do so.

:)

fastreplies
User avatar
canonknipser
Registered User
Posts: 2096
Joined: Thu Sep 08, 2011 4:16 am
Location: Germany
Name: Frank Jakobs
Contact:

Re: IP in registration form

Post by canonknipser »

You can't access $_SERVER in phpBB, it's disabled for security reason.

But the user's IP is already fetched (for check against blacklist and to store it in the registration details).

So you need to put it to the template (look in includes/ucp/ucp_register for the other variables going to the template, you need to add $user->ip) and add it to the template ucp_register.html. This way you put the "naked" IP to the template, but you got the idea ...
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
User avatar
fastreplies
I've Been Banned!
Posts: 372
Joined: Wed Dec 26, 2007 7:08 am

Re: IP in registration form

Post by fastreplies »

canonknipser wrote: Mon Mar 12, 2018 5:11 pmSo you need to put it to the template (look in includes/ucp/ucp_register for the other variables going to the template, you need to add $user->ip) and add it to the template ucp_register.html. This way you put the "naked" IP to the template, but you got the idea ...
Good start, thank you...
and now, ucp_register have around 600 lines.
Where exactly, near which line, we should to add code?

:)

fastreplies
Post Reply

Return to “phpBB Custom Coding”