| 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/membersonly/ |
Upload File : |
<?php
require_once('includes/header.php');
?>
<?php
ini_set('post_max_size', '8M');
ini_set('upload_max_filesize', '8M');
/******************* Lets Database it! nkay? ***************************
************************************************************************
'action' is REQUIRED = either 'put' or 'get'
// get hasn't been developed yet//
The 'get' action is only used to retrieve user data in the survey
database and should rarely be used. It returns a piped string.
if &action=get, you will want to supply the database field name you
want the result pulled on. (ie. &customer_id=12345 in your query str).
//////////////////////////////////
Here are available field names:
`site`,`cust_id`,`name`,`email`,`rate_overall`,`rate_ease`,`ip`,
`rate_content`,`rate_layout`,`our_services`,`improve`,`comments`,
`browser_type`
Thanks for listening!
*************************************************************************
*************************************************************************/
$fb_site = 'usaga';
$qstr['pass']='LemmeIN';
$qstr['site']=$fb_site;
$qstr['action']='put';
$qstr['cust_id']='';// leave blank if you don't have one available.
$qstr['name']=$_POST['name'];
$qstr['email']=$_POST['email'];
$qstr['rate_overall']=$_POST['overall'][0];
$qstr['rate_ease']=$_POST['ease'][0];
$qstr['rate_content']=$_POST['content'][0];
$qstr['rate_layout']=$_POST['layout'][0];
$qstr['our_services']=$_POST['likes'];
$qstr['improve']=$_POST['improvements'];
$qstr['comments']=$_POST['references'];
$qstr['ip']=$_SERVER['REMOTE_ADDR'];
$qstr['browser_type']=$_SERVER['HTTP_USER_AGENT'];
//if( !($result == 'false' or !$result) ){
if(isset($_FILES['img']['tmp_name']) and $_FILES['img']['tmp_name'] != ''){
//resize em and get'm up to the main server
$img = $_FILES['img']['tmp_name'];
$directorya = $_SERVER['DOCUMENT_ROOT']."/membersonly/feedback_images/";
$hook = opendir($directorya);
$imagename = substr(md5(rand(0,1234)),1,6) . ".jpg";
copy($img,$directorya . $imagename);
closedir($hook);
//make sure the file is a jpeg and resize it. copy/resample it in case it is > 72 dpi, then compress it for the web
//kinda a hack, but I couldn't find a better way to resample high-res (ie 300dpi) files, just resize
exec("convert $directorya$imagename -resize 245x204 -quality 100 -compress JPEG $directorya$imagename");
$filename = $directorya . $imagename;
list($current_width, $current_height) = getimagesize($filename);
$canvas = imagecreatetruecolor($current_width, $current_height);
$current_image = imagecreatefromjpeg($filename);
imagecopy($canvas, $current_image, 0, 0, $left, $top, $current_width, $current_height);
imagejpeg($canvas, $filename, 100);
exec("convert $directorya$imagename -resize 245x204 -quality 65 -compress JPEG $directorya$imagename");
// done doing file stuff
$qstr['img']='@'.$directorya.$imagename;
}
$url='cms.surfercrm.com/survey/survey.php';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $qstr);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$test = curl_exec ($ch);
if(isset($_FILES['img']['tmp_name']) and $_FILES['img']['tmp_name'] != ''){
//file has been made,minuplated, optimally compressed, and saved on the main server.
// we don't need it here anymore. Lets Kill it
unlink($directorya . $imagename);
}
//echo $test;
curl_close ($ch);
/**********************************************************************/
?>