It looks like you're new here. If you want to get involved, click one of these buttons!
<div id=\"custom-demo\" class=\"demo\">
<h2>Photo upload</h2>
<script type=\"text/javascript\">
$(function() {
$('#custom_file_upload').uploadify({
'uploader' : 'http://www.xxxxxxxxxxxx.com/xxxx/uploadify/uploadify.swf',
'script' : 'http://www.xxxxxxxxxxxx.com/xxxx/uploadify/uploadify.php',
'cancelImg' : 'http://www.xxxxxxxxxxxx.com/xxxx/uploadify/cancel.png',
'folder' : '/uploads',
'method' : 'POST',
'multi' : true,
'scriptData' : { 'auctionID': '<?php $auctionID;?>'},
'auto' : true,
'fileExt' : '*.jpg;*.gif;*.png',
'fileDesc' : 'Image Files (.JPG, .GIF, .PNG)',
'queueID' : 'custom-queue',
'simUploadLimit' : 3,
'removeCompleted': false,
'onSelectOnce' : function(event,data) {
$('#status-message').text(data.filesSelected + ' files have been added to the queue.');
},
'onAllComplete' : function(event,data) {
$('#status-message').text(data.filesUploaded + ' files uploaded, ' + data.errors + ' errors.');
alert(data.filesUploaded + ' files uploaded successfully!');
}
}); });
</script> if (!empty($_FILES)) {
$auctionID=$_POST['auctionID'];
$tempFile = $_FILES['Filedata']['tmp_name'];
$targetPath = $_SERVER['DOCUMENT_ROOT'] . '/'.'usindustrial'.'/'. $_REQUEST['folder'] . '/';
$targetFile = str_replace('//','/',$targetPath) . $_FILES['Filedata']['name'];
// $fileTypes = str_replace('*.','',$_REQUEST['fileext']);
// $fileTypes = str_replace(';','|',$fileTypes);
// $typesArray = split('\|',$fileTypes);
// $fileParts = pathinfo($_FILES['Filedata']['name']);
// if (in_array($fileParts['extension'],$typesArray)) {
// Uncomment the following line if you want to make the directory if it doesn't exist
// mkdir(str_replace('//','/',$targetPath), 0755, true);
move_uploaded_file($tempFile,$targetFile);
echo str_replace($_SERVER['DOCUMENT_ROOT']. '/'.'usindustrial'.'/','',$targetFile);
//here we have to take a substring because when we request from the server 'DOCUMENT_ROOT' it return
//a bunch of bullshit for the path that we can't use, so we just trim off the first 41 characters of that bullshit leaving us with uploads/yamom.jpg ect.
$subStrFilePath = substr($targetFile,41);
$query = ("INSERT INTO images (path, auctionID)
VALUES
('$subStrFilePath', '$auctionID')");
$results = mysql_query($query, $con);
mysql_close($con); <?php echo $auctionID; ?><?php $auctionID; ?>{ 'auctionID': '<?php $auctionID;?>'},{auctionID: '<?php $auctionID;?>'},