Jump to content

Help returning boolean


Recommended Posts

Hello,

I am trying to implement error proofing to a log in script.  But, I cannot get it to work?  I have no idea what is going on, or why it doesn't work like I expect it to.  I have tried everything, please advise.

 

This is the method I am calling:

public function i_exist($this_username)
{
	//$host_array = null;
	//$host_array = $this->collection->findOne(array("Username" => $this_username));
	//if ($host_array['Username'] = $this_username)
	//{
		return true;
	//}

	//return false;
}

 

This is where I am calling it:

if (!empty($_POST['Username']))
{			
	$host  = new Host();		
	$event = new Event();

	if ($host->i_exist($_POST['Username']))
	{
		header("Location: http://www.drink-social.com/error.php?login=duplicate");	
	}

 

 

It is supposed to check the database and see if that username is already in use.  But it never directs to the error page?  I have even tried commenting everything out and returning true, and returning 1.  Nothing?

Any advice?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.