Location: PHPKode > projects > Plain Text File News Manager > plain-text-file-news-manager/test.php
<?PHP
	require_once('newsedit.php');
	
	$test = new NewsEdit('test.txt');
	
	if($_GET['delete'])
	{
		$test->delete_post($_GET['delete']);
	}
	else if($_GET['edit'])
	{
		$edit_arr='55/55/55|Edit Test|This is to see if the edit test works!|Bob';
		$test->edit_post($edit_arr,$_GET['edit']);	
	}
	else if($_GET['x'])
	{
		$arr=$test->sel_entry($_GET['x']);
		echo "Date: " . $arr[0] . " User: " . $arr[3] . "Subject: " . $arr[1] . "Text: " . $arr[2];
	}
	else 
	{
		$arr=$test->show_post(4);
		foreach ($arr as $value)
		{
			$dsp_arr=explode('|',$value);
			echo "Date: " . $dsp_arr[0] . " User: " . $dsp_arr[3] . "Subject: " . $dsp_arr[1] . "Text: " . $dsp_arr[2] . "<br>";
		}
	}	
	
?>
Return current item: Plain Text File News Manager