MOON
Server: Apache/2.2.21 (Unix) mod_ssl/2.2.21 OpenSSL/0.9.8e-fips-rhel5 mod_auth_passthrough/2.1 mod_bwlimited/1.4
System: Linux vps.panamaemb.org.sg 3.10.0-1160.80.1.vz7.191.4 #1 SMP Thu Dec 15 20:31:06 MSK 2022 x86_64
User: panama (500)
PHP: 5.2.17
Disabled: NONE
Upload Files
File: /home/panama/public_html_old/managesite/services_addnew.php
<?php
	include("../include/config.php"); 
	include("../include/opner_admin.php");
	
	if(strlen(trim($_POST["btnSave"])) > 0)
	{
		
		$newsdate  = $_POST['date'];
		if($_FILES['simg']['name']<>'') {$flag = $functions->isValidImage($_FILES['simg']['type']);};		
		if($flag =='0') {$err_image="Please provide Correct Image Format";	$error=1;	};	
			
		if($error <> 1)
		{
			if($flag > 0)
			{
				// UPLOAD Sign HERE.
				$tokan = array(" ", "'","`","’");
				$image_name 	= time()."_".strtolower(str_replace($tokan, "" , $_FILES['simg']['name']));
				$folder_path 	= "newsimg/";
				copy($_FILES['simg']['tmp_name'] , "../".$folder_path."".$image_name);
			} 
			else 
			{ 
				$image_name ='';
			}		
			
			$db = new database();
			$db->data("title",$functions->anti_injection($_POST['title']));
			$db->data("dat",$newsdate);
			$db->data("simg",$image_name);			
			$db->data("sdesc",$functions->anti_injection($_POST['sdesc']));			
			$db->addnew("embassy_services");
			
			$err_succ = "Record has been stored successfully.";
			header("location:services_list.php");
		}
	}	
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title><?=SITE_ADMIN_TITLE?></title>
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
	<meta name="sdesc" content="<?=META_sdesc?>" />
	<meta name="keywords" content="<?=META_KEYWORD?>" />
	<link href="css.css" rel="stylesheet" type="text/css" />
	<link rel="stylesheet" type="text/css" href="js/style.css" />
	<script type="text/javascript" src="js/lib/prototype.js"></script>
	<script type="text/javascript" src="js/src/effects.js"></script>
	<script type="text/javascript" src="js/validation.js"></script>
	<script src="js/MyFunctions.js"></script>
	<link href="calender/rfnet.css" rel="stylesheet" type="text/css">
	<script type="text/javascript" src="calender/datetimepicker_css.js"></script>
	<!-- TinyMCE -->
	<script type="text/javascript" src="tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
	<script type="text/javascript">
		tinyMCE.init({
			// General options
			mode : "textareas",
			theme : "advanced",
			plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",
	
			// Theme options
			theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
			theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
			theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
			theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak",
			theme_advanced_toolbar_location : "top",
			theme_advanced_toolbar_align : "left",
			theme_advanced_statusbar_location : "bottom",
			theme_advanced_resizing : true,
	
			// Example content CSS (should be your site CSS)
			content_css : "css/content.css",
	
			// Drop lists for link/image/media/template dialogs
			template_external_list_url : "lists/template_list.js",
			external_link_list_url : "lists/link_list.js",
			external_image_list_url : "lists/image_list.js",
			media_external_list_url : "lists/media_list.js",
	
			// Replace values for the template plugin
			template_replace_values : {
				username : "Some User",
				staffid : "991234"
			}
		});
	</script>
	<!-- /TinyMCE -->
</head>
<body onLoad="javascript:showhide('refrence');">
<table width="100%" border="0" cellspacing="0" cellpadding="0" >
  <tr>
    <td><? include("header.php")?></td>
  </tr>
  <tr>
	<td valign="top" width="82%">
	<form name="frmabout" id="frmabout" action="services_addnew.php" method="post" enctype="multipart/form-data">
	  <table width="100%" border="0" cellpadding="0" cellspacing="0" class="inertable">
		<!--<tr>
		  <td width="72%" colspan="2" class="inertr" style="padding-left:7px" ><img src="images/bullet_new.png" align="absmiddle" />&nbsp;&nbsp;Add new News  </td>
		  <td width="28%" class="inertr" align="right" style="padding-right:10px">&nbsp;</td>
		</tr>-->
		<tr>
				<td class="inertr" style="padding-left:7px" colspan="2"><img src="images/bullet_new.png" align="absmiddle" />&nbsp;&nbsp;Add new News </td>
			</tr>
			<tr>
			   <td colspan="2">&nbsp;</td>
			</tr>
		
		<tr>
		  <td colspan="2" align="center"><table width="70%" border="0" cellspacing="0" cellpadding="0" class="text">
			  <tr>
				<td><table width="100%" border="0" cellpadding="0" cellspacing="0" class="text">
					<tr>
					  <td height="20" colspan="4" align="center"><span class="success"><? echo $err_succ ?></span></td>
					</tr>
					<tr>
					  <td colspan="2" align="right" valign="top" class="textbold">Title &nbsp;</td>
					  <td colspan="2" align="left">
					    <input type="text" name="title" id="title" class="required" size="35" /></td>
					</tr>
					<tr>
					  <td colspan="4" align="center">&nbsp;</td>
					</tr>
					
					<tr>
					  <td colspan="2" align="right" valign="top" class="textbold">Date &nbsp;</td>
					  <td colspan="2" align="left">
					    <input type="text" id="date" maxlength="25" size="25" name="date" value="<?=$datetime?>" readonly="" class="required"/>
						<a href="javascript:NewCssCal('date','yyyymmdd')"><img src="images/cal.gif" width="16" height="16" alt="Pick a date"></a>
					  </td>
					</tr>
					<tr>
					  <td colspan="4" align="center">&nbsp;</td>
					</tr>
					
					<tr>
					  <td colspan="2" align="right" valign="top" class="textbold">Image &nbsp;</td>
					  <td colspan="2" align="left" valign="top"><input type="file" name="simg" size="35" class="filebgcolor"/><br><span class="error">&nbsp;<?=$err_image;?></span></td>
					  </tr>
					<tr>
					  <td colspan="2" align="right" valign="top" class="textbold">Description &nbsp;</td>
					  <td colspan="2" align="left">
					    <textarea id="sdesc" name="sdesc" class="required" rows="15" cols="50"></textarea></td>
					</tr>
					<tr>
					  <td colspan="4" align="center">&nbsp;</td>
					</tr>
					<tr>
					  <td colspan="2" align="center">&nbsp;&nbsp;</td>
					  <td colspan="2" align="left"><input name="btnSave" type="submit" class="btn" value="Save" style="border:none;" />&nbsp;&nbsp;<input name="btnBack" type="submit" class="btn" value="Back to List" onClick="javascript:location.href='services_list.php'" style="border:none;" /></td>
					</tr>
					<tr>
					  <td colspan="2" align="center">&nbsp;</td>
					  <td align="left">&nbsp;</td>
					  <td align="left">&nbsp;</td>
					  </tr>
				  </table>
				 </td>
			  </tr>
			</table></td>
		</tr>
		<tr>
		  <td align="left" colspan="3" >&nbsp;</td>
		</tr>
	  </table>
	</form>
	<script type="text/javascript">
		function formCallback(result, form) {
			window.status = "valiation callback for form '" + form.id + "': result = " + result;
		}
		
		var valid = new Validation('frmabout', {immediate : true, onFormValidate : formCallback});
	</script>
	<script type="text/javascript" src="js/change_backcolor.js"></script>
</td>
  </tr>
  <tr><td height="50"></td></tr>  
</table>
</body>
</html>