Using phpbb_hash function

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
Tyler Ramsay
Registered User
Posts: 2
Joined: Tue Nov 07, 2017 5:45 pm

Using phpbb_hash function

Post by Tyler Ramsay » Tue Nov 07, 2017 5:51 pm

Hi There,

I am trying to use the PHP bb hash function but am running into some issues. Can anyone seem to help me? I am getting either a white page or a Error 500 page.

Code: Select all

<?php

include('phpbb3/common.php');

$password = 'my_password';

$hash = phpbb_hash($password);

echo($hash);

if (phpbb_check_hash($password, $hash))
{
	echo(' => $password matches $hash');
}

?>

User avatar
AmigoJack
Registered User
Posts: 4946
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン
Contact:

Re: Using phpbb_hash function

Post by AmigoJack » Wed Nov 08, 2017 9:02 am

Tyler Ramsay wrote:
Tue Nov 07, 2017 5:51 pm
a white page

Code: Select all

<?php
include('phpbb3/common.php');
If you would have looked into that file you would have seen that the very first code lines are:

Code: Select all

if (!defined('IN_PHPBB'))
{
	exit;
Do you understand now? If yes, you will also define $phpbb_root_path and $phpEx. Or look at a file which must do all this anyway (i.e. /viewtopic.php).
The worst thing about censorship is ███████████

Tyler Ramsay
Registered User
Posts: 2
Joined: Tue Nov 07, 2017 5:45 pm

Re: Using phpbb_hash function

Post by Tyler Ramsay » Thu Nov 09, 2017 12:32 pm

Thank you AmigoJack!

I was able to get it working perfectly!

I appreciate it.

Post Reply

Return to “phpBB Custom Coding”

Who is online

Users browsing this forum: No registered users and 3 guests