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
https://forums.phpfreaks.com/topic/261874-help-returning-boolean/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.