PK

ADDRLIN : /home/anibklip/adhocacademy.com/admin/news/
FLL :
Current File : /home/anibklip/adhocacademy.com/admin/news/news_action.php

<?php
		include_once('../../include/connection.php');
		include_once('../../include/common.php');
		
		//print_r($_POST);
		 $news=$_POST['news'];
		 $status=$_POST['status'];
		
		
		if($_POST['action']=='add')
		{
				$sel="INSERT INTO news 
									(news,status) 
								VALUES
									('".$news."','".$status."')";
				$result=mysql_query($sel);
				header('location: news_list.php');
		}
		
		if($_POST['action']=='edit')
		{
			$upd="UPDATE news 
							SET
								news='".$news."',
								status='".$status."'
							WHERE id='".$_POST['id']."'";
			$result=mysql_query($upd);
			header('location: news_list.php');
		}
		
		if($_GET['action']=='delete')
		{
			$del="DELETE FROM news where id='".$_GET['id']."'";
			$result=mysql_query($del);
			header('location: news_list.php');
		}
		


?>


PK 99