5tarl0rd

Current Path : /home/tiporg/www/manage/
Upload File :
Current File : /home/tiporg/www/manage/add_downloads.php

<?php 

include("classes/access_user_class.php"); 



$page_protect = new Access_user;

// $page_protect->login_page = "login.php"; 

$page_protect->access_page(); 



if (isset($_GET['action']) && $_GET['action'] == "log_out") {

	$page_protect->log_out(); // the method to log off

}



	if(isset($_REQUEST['Submit']))

	{

			$descn = addslashes($_REQUEST['descn']);

			$title = $_REQUEST['title'];

			$status = 0;

									

			if ($_FILES["userfile"]["name"] == "")

		  	{

		  		$img = "";

		  	}

			else

		  	{

		  		$target_path = "../docdata/";

				$target_path = $target_path.$_FILES['userfile']['name']; 

				$img =  $_FILES['userfile']['name']; 

				move_uploaded_file($_FILES['userfile']['tmp_name'], $target_path);

			}

			$string = "insert into tbl_downloads(title,descn,document,status) VALUES ('".$title."','".$descn."','".$img."','".$status."')"; 

				mysql_query($string) or die(mysql_error());

				$msg="Document has been added successfully";

				header("location:downloads.php?mess=$msg");

	}

?>

<!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>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<title>Control Panel</title>

<link rel="stylesheet" type="text/css" href="js/calendar.css">

<script type="text/javascript" src="js/calendar.js?random=20060118"></script>

<script type="text/javascript" src="js/validator.js"></script>

<script language="javascript" type="text/javascript" src="js/tiny_mce/tiny_mce.js"></script>



<script language="javascript" type="text/javascript">

tinyMCE.init({

	mode : "textareas",

	theme : "advanced",

	plugins : "devkit,style,layer,table,save,advhr,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,simplebrowser",

       plugin_simplebrowser_width : '500', //default

       plugin_simplebrowser_height : '600', //default

       plugin_simplebrowser_browselinkurl : 'simplebrowser/browser.html?Connector=connectors/php/connector.php',

       plugin_simplebrowser_browseimageurl:'simplebrowser/browser.html?Type=Image&Connector=connectors/php/connector.php',

   plugin_simplebrowser_browseflashurl:'simplebrowser/browser.html?Type=Flash&Connector=connectors/php/connector.php',

	   

		//theme_advanced_buttons1_add_before : "save,newdocument,separator",

		theme_advanced_buttons1_add : "fontselect,fontsizeselect",

		theme_advanced_buttons2_add : "separator,insertdate,inserttime,preview,separator,forecolor,backcolor",

		theme_advanced_buttons2_add_before: "cut,copy,paste,pastetext,pasteword,separator,search,replace,separator",

		//theme_advanced_buttons3_add_before : "tablecontrols,separator",

		//theme_advanced_buttons3_add : "emotions,iespell,media,advhr,separator,print,separator,ltr,rtl,separator,fullscreen",

		//theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,|,code",

		theme_advanced_toolbar_location : "top",

		theme_advanced_toolbar_align : "left",

		theme_advanced_path_location : "bottom",

		content_css : "example_full.css",

		editor_deselector : "No_MCE_Editor" ,

	    plugin_insertdate_dateFormat : "%Y-%m-%d",

	    plugin_insertdate_timeFormat : "%H:%M:%S",

		extended_valid_elements : "hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]",

		file_browser_callback : "TinyMCE_simplebrowser_browse",

		theme_advanced_resize_horizontal : false,

		theme_advanced_resizing : true,

		nonbreaking_force_tab : true,

		apply_source_formatting : true,

		template_replace_values : {

			username : "Jack Black",

			staffid : "991234"

		},

		relat2ive_urls : false,

		rem2ove_script_host : false

	

});



	function fileBrowserCallBack(field_name, url, type, win) 

	{

/*		// This is where you insert your custom filebrowser logic

		//alert("Example of filebrowser callback: field_name: " + field_name + ", url: " + url + ", type: " + type);

		var dest = '\tiny_mce\plugins\advimage\images';

		window.open("uploadimage.php","_popup","toolbars=0,location=300,width=300,height=150");

		// Insert new URL, this would normaly be done in a popup		

		win.document.forms[0].elements[field_name].value =dest;

*/	

   var fileBrowserWindow = new Array();

    fileBrowserWindow['title'] = 'File Browser';

    fileBrowserWindow['file'] = "uploadimage.php" + "?type=" + type;

    fileBrowserWindow['width'] = '420';

    fileBrowserWindow['height'] = '400';

    tinyMCE.openWindow(fileBrowserWindow, { window : win, resizable : 'yes', inline : 'no' });

	win.document.forms[0].elements[field_name].value = id;

    return false;

     }

	



</script>

<link href="css/main.css" rel="stylesheet" type="text/css" />

</head>



<body>

 



<?php include("includes/header.php");?>



<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">



  <tr>

    <td rowspan="3" align="left" background="images/white_left_bar.gif"></td>

    <td align="center"></td>

    <td width="1%" rowspan="3" align="right" background="images/white_right_bar.gif">&nbsp;</td>

  </tr>

  <tr>

    <td>&nbsp;</td>

  </tr>

  <tr>

    <td width="99%"><table width="98%" border="0" align="center" cellpadding="2" cellspacing="2">

      <tr>

        <td width="20%" valign="top"><?php require_once("includes/left_column.php");?></td>

        <td width="80%" valign="top"><table width="100%" border="0" align="center" cellpadding="2" cellspacing="2" bordercolor="#cccccc" class="tableBorder">

          <tr>

            <td align="center"colspan="2" bgcolor="#EFEFEF" class="boldText">Add Downloads </td>

          </tr>

          <tr>

            <td colspan="2" align="left" valign="top" background="#F6F6F6" class="errorText">			</td>

          </tr>

          <tr>

            <td colspan="2" align="left" valign="top"><form  method="post" enctype="multipart/form-data"  name="addpages" id="addpages">

						 

						<table width="100%" border="0" align="right" cellpadding="2" cellspacing="2">

                          <tr>

                            <td width="100%" colspan="2" align="right"><a href="downloads.php">Go Back</a></td>

                          </tr>

                          <tr>

                            <td colspan="2"><table width="100%" border="0" cellspacing="0" cellpadding="0">

                              <tr>

                                <td width="21%">&nbsp;</td>

                                <td width="79%">&nbsp;</td>

                              </tr>

                              



                               

                               

                               <tr>

                                <td class="mainText">Title : </td>

                                <td>

								<input type="text" name="title" id="title" value="" />								</td>

                              </tr>

                               

                               <tr>

                                 <td class="mainText">&nbsp;</td>

                                 <td>&nbsp;</td>

                               </tr>

                               



							  <tr>

                                <td class="mainText">Document : </td>

                                <td><input name="userfile" type="file" id="userfile" /></td>

                              </tr>

                              <tr>

                                <td class="mainText">&nbsp;</td>

                                <td>&nbsp;</td>

                              </tr>

                              <tr>

                                <td class="mainText">Description : </td>

                                <td>&nbsp;</td>

                              </tr>

                              <tr>

                                <td colspan="2">

								  <textarea name="descn" id="descn" cols="80"></textarea>								  

								  </td>

                              </tr>

                              <tr>

                                <td colspan="2">&nbsp;</td>

                              </tr>

                              

                            </table></td>

                          </tr> 

				          <tr>

                            <td colspan="2" align="center" valign="top" class="mainText">                            </td>

                          </tr>

                          <tr >

                          <td colspan="2" align="center" class="label">

						  <input type="submit" name="Submit" value="Submit">

						  </td>

                          </tr>

                    </table>

						</form></td>

          </tr>

        </table></td>

      </tr>

    </table>    </td>

  </tr>

  <tr>

    <td ><img src="images/white_left_bottom_corner.gif" width="9" height="9" /></td>

    <td width="99%" background="images/white_bottom_bar.gif"><img src="images/white_bottom_bar.gif" width="4" height="9" /></td>

    <td width="1%"><img src="images/white_right_bottom_corner.gif" width="9" height="9" /></td>

  </tr>

</table>

</body>

</html>

5tarL0rd By 5tarl0rd Being Anonymous