Location: PHPKode > projects > Prsaar Social Networking Platform > PrsaarColour-0.7.alpha.6.3/pr-inside/addscratch.php
<?php
	unset($Error);
	$AddScratch = false;
	if(empty($_POST['user_name']))
		$Error['user_name'] = 'Please provide your name';
	if(empty($_POST['user_mail']))
		$Error['user_mail'] = 'Please provide your E-mail';
	if(empty($_POST['user_url']))
		$_POST['user_url'] = false;
	if(empty($_POST['value']))
		$Error['value'] = 'Please write the scratch';
	
	if(isset($Error))
	{
		foreach($Error as $KeyValue)
			print $KeyValue." <br /> ";
	}
	else
	{
		$ScratchTime = date("YmdHis");
		require_once(PR_PATH."/pr-inside/convert-to-html.php");
		$UserName = ConvertToHTML($_POST['user_name']);
		$UserMail = ConvertToHTML($_POST['user_mail']);
		$UserURL = ConvertToHTML($_POST['user_url']);
		$Value = ConvertToHTML($_POST['value']);
		
		$DC->Result(" INSERT INTO ".PR_DATABASE_PREFIX."scratch SET scratch_user_name = '{$UserName}', scratch_user_mail = '{$UserMail}', scratch_user_url = '{$UserURL}', scratch_value = '{$Value}', scratch_time = '{$ScratchTime}', scratch_status = 'moderate'");
		$AddScratch = true;
	}
?>
Return current item: Prsaar Social Networking Platform