It looks like you're new here. If you want to get involved, click one of these buttons!

$("#file_upload").uploadify({
'uploader' : '/uploadify/uploadify.swf',
'script' : '/uploadify/uploadify.php',
'cancelImg' : '/uploadify/cancel.png',
'folder' : 'assets/images/uploads',
'auto' : false, // files are automatically uploaded
'multi' : false, // enable several files to upload
'querySizeLimit' : 1,
'fileExt': '*.jpg;*.jpeg;*.gif;*.png',
'sizeLimit' : 102400,
'wmode' : 'transparent',
'buttonText' : 'Select a file ',
'onComplete' : function (event,ID,fileObj,response,data){
$("#msguplaud").append("<div><p>הקובץ: " + fileObj.name +" הועלה בהצלחה!! <br/>הנתיב לתמונה הוא:" + fileObj.filePath + "<br/>אנא השתמש בנתיב רק אם ברצונך לצרפו לתוכן!!!</p></div>");
imgpath = fileObj.filePath;
},
'checkScript' : '/assets/js/libs/uploadify/check.php',
'onCheck' : function(event,data,key) {
$('#file_upload' + key).find('.percentage').text(' - Exists');
}
} );
<p>
<label for="file_upload">upload</label>
<input type="file" name="file_upload" id="file_upload" value="" />
<a href="javascript:$('#file_upload').uploadifyUpload();">Upload File</a><br/>
<div id="msguplaud"></div><br/>
</p>
uploadifyLang['buttonText'] = 'Selecteer bestanden';
uploadifyLang['fileTypeDesc'] = 'Alle bestanden (*.*)';
uploadifyLang['replaceMsg1'] = 'Het bestand';
uploadifyLang['replaceMsg2'] = 'staat al in de wachtrij.';
uploadifyLang['replaceMsg3'] = 'Wilt u het bestaande bestand in de wachtrij vervangen?';
uploadifyLang['existsMsg1'] = 'Een bestand met de naam';
uploadifyLang['existsMsg2'] = 'bestaat al op de server.';
uploadifyLang['existsMsg3'] = 'Wilt u het bestaande bestand overschrijven?';
uploadifyLang['errorMsg1'] = 'Sommige bestanden zijn niet aan de wachtrij toegevoegd:';
uploadifyLang['errorMsg2'] = 'Het geselecteerde aantal bestanden overschrijdt de resterende upload limiet';
uploadifyLang['errorMsg3'] = 'Het geselecteerde aantal bestanden overschrijdt de wachtrij limiet';
uploadifyLang['errorMsg4'] = 'Het bestand';
uploadifyLang['errorMsg5'] = 'overschrijdt de maximale bestandsgrootte.';
uploadifyLang['errorMsg6'] = 'is leeg.';
uploadifyLang['errorMsg7'] = 'is van een niet geaccepteerd type.';
uploadifyLang['errorString1'] = 'Error';
uploadifyLang['errorString2'] = 'HTTP Error';
uploadifyLang['errorString3'] = 'Ontbrekende Upload URL';
uploadifyLang['errorString4'] = 'IO Error';
uploadifyLang['errorString5'] = 'Beveiligings Error';
uploadifyLang['errorString6'] = 'De upload limiet is bereikt.';
uploadifyLang['errorString7'] = 'Overschrijdt de upload limiet.';
uploadifyLang['errorString8'] = 'Mislukt.';
uploadifyLang['errorString9'] = 'Bestand ID niet gevonden.';
uploadifyLang['errorString10'] = 'Validatie Error';
uploadifyLang['errorString11'] = 'Geannuleerd';
uploadifyLang['errorString12'] = 'Gestopt';
uploadifyLang['uploadComplete'] = 'Voltooid'; <?php include("header.php");?>
<script type="text/javascript">
function doFormSubmit() {
// GRAB FIELDS VALUES AND SEND TO uploadify.php, YOU CAN DO WHATEVER YOU WANT WITH THEM IN uploadify.php FILE
var myObjVars = {};
$("form[id$=myForm] input").each(function () {
switch ($(this)[0].type) {
case "text":
myObjVars[$(this)[0].id] = $(this).val();
break;
}
});
$('#gallery').uploadifySettings('postData', myObjVars);
// UPLOAD IMAGES
$('#gallery').uploadifyUpload();
}
$(document).ready(function() {
if (!FlashDetect.versionAtLeast(9)) {
$("#gallery").html('You do not have Flash Player installed or your Flash Player is too old!<br>Please install Flash Player 9 or higher.');
} else {
$("#gallery").uploadify({
// Required Settings
langFile : 'jquery.uploadify-v3.0.0/uploadifyLang_en.js',
swf : 'jquery.uploadify-v3.0.0/uploadify.swf',
uploader : 'jquery.uploadify-v3.0.0/uploadify.php',
// Options - HERE ARE ALL USEFUL OPTIONS, DON'T USE ANYTHING THAT ISN'T LISTED HERE
'folder' : '/tryme/uploads',
'createFolder' : true,
'debug' : true, // DON'T SET THIS TO TRUE UNLESS YOU NEED TO SEE IF THERE IS ANY ERROR IN YOUR SCRIPT. IN YOUR SITE, JUST DON'T USE THIS OPTION AT ALL
'auto' : false,
'buttonText' : 'Select Images',
'width' : 150,
'height' : 30,
'cancelImage' : 'jquery.uploadify-v3.0.0/uploadify-cancel.png',
'checkExisting' : 'jquery.uploadify-v3.0.0/uploadify-check-exists.php',
'fileSizeLimit' : 1*1024, // 1MB
'fileTypeDesc' : 'Image Files',
'fileTypeExts' : '*.gif;*.jpg;*.png',
'method' : 'post',
'multi' : true,
'queueID' : 'fileQueue',
'queueSizeLimit' : 999,
'removeCompleted' : true,
'postData' : {},
'progressData' : 'all',
onSelect : function(file) {
$("#formFields").append("<tr id='table_"+file.id+"'><td align='left'>Caption for: <b>"+file.name+"</b>:</td><td align='left'><input type='text' id='img_"+file.id+"_title' name='img_"+file.id+"_title' value='' /></td></tr><tr><td><select id='img_"+file.id+"_intExt' name='img_"+file.id+"_intExt'><option value='interior'>Interior</option><option value='exterior'>Exterior</option></select></td></tr>");
},
onUploadSuccess : function(file,data,response) {
$("#myForm").append("<input type='hidden' id='img_"+file.id+"_fileName' name='img_"+file.id+"_fileName' value='"+data+"' />"); // INSERT IMAGE FILENAME IN A HIDDEN FORM FIELD
},
onQueueComplete: function (stats) {
$('#myForm').submit(); // THIS IS AN EXAMPLE, YOU CAN SUBMIT YOUR INFOS WITH AJAX IF YOU WANT
}
});
}
});
</script>
<?php
$link = mysql_connect('localhost', 'username', 'password');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_select_db("databasename", $link);
$submitting = $_REQUEST['submitting'];
echo $submitting;
if ($submitting == 'yes') {
// REQUEST POST INFOS
foreach ($_REQUEST as $var => $value) {
if (stripos($var, 'img_SWFUpload_') !== false) {
if (stripos($var, '_title') !== false){
$img_title[] = $value;
}
if (stripos($var, '_fileName') !== false){
$img_fileName[] = $value;
}
if (stripos($var, '_intExt') !== false){
$img_intExt[] = $value;
}
} else {
$$var = $value;
echo "$var: ".$$var."<br>";
}
}
foreach ($img_fileName as $i => $value) {
echo "img_title[$i]: $img_title[$i]<br>";
echo "img_fileName[$i]: $img_fileName[$i]<br>";
echo "img_intExt[$i]: $img_intExt[$i]<br>";
$sql="INSERT INTO store_images ( filename, interior_exterior, caption)
VALUES
('$img_fileName[$i]', '$img_intExt[$i]','$img_title[$i]')";
if (!mysql_query($sql,$link))
{
die('Error: ' . mysql_error());
}
echo "1 record added";
}
echo '<br>';
}
mysql_close($link);
?>
<form name='myForm' id='myForm' method='post' action='<?=$_SERVER['PHP_SELF']?>'>
<input type='hidden' id='submitting' name='submitting' value='yes' />
<table id='formFields' width='600' border='0' rules='none' frame='box' style='background-color: #FFFFFF; border: 1px solid #CC0000;' cellspacing='0' cellpadding='5' align='center'>
</table>
<br><br>
<table width='600' border='0' cellspacing='0' cellpadding='2' align='center'><tr>
<td align='left'>Images:</td>
<td align='right'><font style='font-size:10px;'><a href='#' onClick="jQuery('#gallery').uploadifyCancel('*'); return false;">(Clear Images List)</a></font></td>
</tr></table>
<table width='600' border='0' rules='none' frame='box' style='background-color: #FFFFFF; border: 1px solid #1f6798;' cellspacing='0' cellpadding='5' align='center'>
<tr><td align='center'>
<div id='gallery'>You've got a problem with your JavaScript</div>
</td></tr>
</table>
<br><br>
<table width='600' border='0' cellspacing='0' cellpadding='2' align='center'><tr>
<td align='left'>fileQueue:</td>
</tr></table>
<table width='600' border='0' rules='none' frame='box' style='background-color: #FFFFFF; border: 1px solid #CC0000;' cellspacing='0' cellpadding='5' align='center'>
<tr><td align='center'>
<div id='fileQueue'></div>
</td></tr>
</table>
<br>
<center><button type="button" name="btSubmit" id="btSubmit" onClick="doFormSubmit()">Upload and Submit</button></center>
<br>
</form>
// this file must be in UTF-8 format
// Italian version by GMurabito
var uploadifyLang = new Array();
uploadifyLang['buttonText'] = 'Seleziona Files';
uploadifyLang['fileTypeDesc'] = 'Tutti i file (*.*)';
uploadifyLang['replaceMsg1'] = 'Il file nominato';
uploadifyLang['replaceMsg2'] = 'è già in coda';
uploadifyLang['replaceMsg3'] = 'Vuoi sostituire l\'elemento esistente in coda?';
uploadifyLang['existsMsg1'] = 'Il file chiamato';
uploadifyLang['existsMsg2'] = 'già esiste sul server.';
uploadifyLang['existsMsg3'] = 'Vuoi sostituire il file esistente?';
uploadifyLang['errorMsg1'] = 'Alcuni file non sono stati aggiunti alla coda:';
uploadifyLang['errorMsg2'] = 'Il numero di files selezionati eccede il limite dell\'upoload rimanente';
uploadifyLang['errorMsg3'] = 'Il numero di files selezionati eccede il limite della grandezza della coda';
uploadifyLang['errorMsg4'] = 'Il file';
uploadifyLang['errorMsg5'] = 'supera il limite di grandezza';
uploadifyLang['errorMsg6'] = 'è vuoto.';
uploadifyLang['errorMsg7'] = 'non ha un\'estensione accettata.';
uploadifyLang['errorString1'] = 'Errore';
uploadifyLang['errorString2'] = 'Errore HTTP';
uploadifyLang['errorString3'] = 'URL Upload mancante';
uploadifyLang['errorString4'] = 'Errore IO' ;
uploadifyLang['errorString5'] = 'Errore di Sicurezza';
uploadifyLang['errorString6'] = 'Il limite di Upload è stato raggiunto';
uploadifyLang['errorString7'] = 'Supera il limite di Upload';
uploadifyLang['errorString8'] = 'Fallito';
uploadifyLang['errorString9'] = 'File ID non trovato';
uploadifyLang['errorString10'] = 'Errore di Validazione';
uploadifyLang['errorString11'] = 'Cancellato';
uploadifyLang['errorString12'] = 'Stoppato';
uploadifyLang['uploadComplete'] = 'Completato';
jQuery('[id*='+queuedFile.id+']').remove();jQuery('#'+queuedFile.id).remove();jQuery('[id*='+file.id+']').fadeOut(500,function() {jQuery('#'+file.id).fadeOut(500,function() {