Page 1 of 1

Hide Array

Posted: Mon Jun 14, 2010 10:53 pm
by jayman228
Hello,

I'm trying to implement a new user login page that will register the user into a Sharetronix system and the myBB forum at the same time. I was able to get it to work; however, after the user clicks "Submit" on the form it shows the actual array information. MyBB has a page integration page (class.MyBBIntegrator.php)that someone created that helps with the new user process...Anyways, I was wondering if there was a way to hide the array information and just "do it" behind the scenes. I do like the note saying i'm registered, not, password issue, etc BUT I don't want to show the end user the array part.

Code: Select all

//define, open files, declare mybbi
define('IN_MYBB', NULL);
require_once '../forum/global.php';
require_once '../forum/inc/class.MyBBIntegrator.php';
$MyBBI = new MyBBIntegrator($mybb, $db, $cache, $plugins, $lang, $config); 

//declare the registration array for the forum
$info = array(
    'username' => $_POST[username],
    'password' => $_POST[password],
    'password2' => $_POST[password],
    'email' => $_POST[email],
    'email2' => $_POST[email],
    'hideemail' => 1,
    'invisible' => 0,
    'receivepms' => 1
);

//declare registration status along with registering user
$register_status = $MyBBI->register($info);

// Array means: registering failed
if (is_array($register_status))
{
    echo implode('<br />', $register_status);
}
else
{
    echo $register_status;
For example, when the user clicks Submit on the form, I see:

Code: Select all

Array
(
    [username] => Jason
    [password] => jason
    [password2] => jason
    [email] => jason@dajman.com
    [email2] => jason@dajman.com
    [hideemail] => 1
    [invisible] => 0
    [receivepms] => 1
    [referrer] => 
    [timezone] => 
    [language] => 
    [profile_fields] => 
    [allownotices] => 
    [subscriptionmethod] => 
    [pmnotice] => 
    [emailpmnotify] => 
    [dstcorrection] => 
)

The username you entered already exists. Please enter a different username.
The password you entered is of invalid length. Please enter a password between 6 and 30 characters.
You have entered an email address that is already in use by another member. Please enter a different email address.
Any help would be great.

Thanks, Jason

Re: Hide Array

Posted: Mon Jun 14, 2010 10:59 pm
by requinix
Somewhere there's a call to print_r. Find it and remove it.

Re: Hide Array

Posted: Mon Jun 14, 2010 11:17 pm
by jayman228
tasairis wrote:Somewhere there's a call to print_r. Find it and remove it.
Think I found it. Thank you SO much. Your a life saver. :-)