Location: PHPKode > projects > RabbitBB - Online Web Storage Project > mywebdrive/PHP_CON/register/BSRegister.php
<?PHP

class BSRegister
{
	function BSRegister()
	{
	}

	function submit($_request, $_response)
	{
		@reset($_request);

		$_response['formerror'] = array();
		$_response['finished'] = false;
		
		if (isset($_request['parampath']))
		{
			include($_request['parampath']);
			foreach($_request as $key=>$value)
			{
				if (isset($fielddata[$key]))
				{
					$_response['formvalue'][$key] = $value;
					
					$_param = $fielddata[$key];
					$_paramarr = explode(":", $_param);

					if ($_paramarr[0]=="text")
					{
						
					}
					elseif ($_paramarr[0]=="email")
					{
						if (!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $value))
						
						$_response['formerror'] = $this->setarr($_response['formerror'], $key, "EMAILFORMAT");
					}

					if (($_paramarr[1]<strlen($value)) && ($_paramarr[1]>0))
					{
						
						$_response['formerror'] = $this->setarr($_response['formerror'], $key, "TOOLONG");

					}

					if (isset($_paramarr[2]) && ($_paramarr[2]!=""))
					{
						if ($_paramarr[2]=="T")
						{
							if (strlen($value)==0)
							{
								$_response['formerror'] = $this->setarr($_response['formerror'], $key, "EMPTY");

							}
						}
						elseif ($_paramarr[2] == "F")
						{
						}
					}
				}
			}

			if (count($_response['formerror'])==0)
			{
			}
			else
			{
				$_response['error'] = "PARAMCHECKERROR";
			}
		}
		else
		{
			$_response['error'] = "NOFORMPARAM";
		}

		return $_response;
	}

	function setarr($_arr, $_key, $_value)
	{
		if (!isset($_arr[$_key]))
		{
			$_arr[$_key] = array();
		}
		$_arr[$_key][] = $_value;
		return $_arr;
	}
}

?>
Return current item: RabbitBB - Online Web Storage Project