Location: PHPKode > projects > RSS Link Adder > RSS_Reader/RssLinkAdderObj.php
<?php
	session_start();
	include 'classes/RssLinkAdder.php';
	$link_obj = new RssLinkAdder();
	$_SESSION['rss_name'] = $_POST['rss_name'];
	$_SESSION['rss_url'] = $_POST['rss_url'];
		
		if($_POST['rss_name']=="")
		{
			$falg = 1;
			$_SESSION['error_notxt'] = "Please Enter content Name !";
			header("Location:../home.php");
		}
		elseif(ctype_digit($_POST['rss_name']))
		{
			$falg = 1;
			$_SESSION['error_notchar'] = "Please enter relevant Name !";
			header("Location:../home.php");
		}
		elseif($_POST['rss_url']=="")
		{
			$_SESSION['error1'] = "Please Enter Url !";
			$falg = 1;
			header("Location:../home.php");
		}
		else
		{
			$url_test = preg_match('@^(?:http://)([^/]+)@i',$_POST['rss_url']);
			if(!$url_test)
			{	
				$_SESSION['error2'] = "invalid Url";
				$flag = 1;
				header("Location:../home.php");
				
			}
			else
			{
				
				if($flag==0)
				{
					$sql = "INSERT INTO rsslinks_table (link_name,link_url) VALUES('".$_POST['rss_name']."','".$_POST['rss_url']."')";
					$insert_ret = $link_obj->insertLink($sql);
				}
			}
				
		}
	header("Location:index.php");
?>
Return current item: RSS Link Adder