It looks like you're new here. If you want to get involved, click one of these buttons!
<link href=\"css/uploadify.css\" rel=\"stylesheet\" type=\"text/css\" />
<script type=\"text/javascript\" src=\"js/jquery/jquery.js\"></script>
<script type=\"text/javascript\" src=\"js/jquery/jquery.uploadify.v2.1.0.min.js\"></script>
<script type=\"text/javascript\" src=\"js/swfobject.js\"></script>
<script type=\"text/javascript\">
$(document).ready(function() {
$(\"#uploadify\").uploadify({
'uploader' : 'js/uploadify.swf',
'script' : 'classes/upload.php?Vorschaubreite=100&Qualitaet=80&Prozess=Starten&ID=1337',
'cancelImg' : 'images/fancy_closebox.png',
'folder' : '../../Bildergalerie/1337',
'queueID' : 'fileQueue',
'auto' : false,
'multi' : true,
'buttonText' : 'Dateiauswahl',
'fileDesc' : 'JPG, GIF, PNG erlaubt!',
'fileExt' : '*.jpg;*.png;*.gif',
});
});
</script>
<form name='formular' id=\"formular\" method='post' class='niceform'>
<fieldset>
<legend>Bilder hochladen</legend>
<dl>
<dd><input type=\"file\" name=\"uploadify\" id=\"uploadify\" />
<p><a href=\"javascript:$('#uploadify').uploadifyUpload();\">Hochladen</a> | <a href=\"javascript:$('#uploadify').uploadifyClearQueue()\">Alles Abbrechen</a></p>
<div id=\"fileQueue\"></div>
</dd>
</dl>
</fieldset>
</form>
<?php
/*
Uploadify v2.1.0
Release Date: August 24, 2009
Copyright (c) 2009 Ronnie Garcia, Travis Nickels
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the \"Software\"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
include(\"../../config.php\");
include(\"../../mysql.php\");
include(\"sicherheit.php\");
$Vorschaubreite = $_GET['Vorschaubreite'];
$Qualitaet = $_GET['Qualitaet'];
$ID = $_GET['ID'];
function Upload($Vorschaubreite,$Qualitaet,$ID) {
if (!empty($_FILES)) {
$tempFile = $_FILES['Filedata']['tmp_name'];
$targetPath = $_SERVER['DOCUMENT_ROOT'] . $_GET['folder'] . '/';
$targetPath = str_replace('//','/',$targetPath);
$targetFile = $targetPath . $_FILES['Filedata']['name'];
move_uploaded_file($tempFile,$targetFile);
}
$imgsize = getimagesize($targetFile);
switch(strtolower(substr($targetFile, -3))){
case \"jpg\":
$image = imagecreatefromjpeg($targetFile);
break;
case \"png\":
$image = imagecreatefrompng($targetFile);
break;
case \"gif\":
$image = imagecreatefromgif($targetFile);
break;
default:
exit;
break;
}
$height = $imgsize[1]/$imgsize[0]*$Vorschaubreite; //This maintains proportions
$src_w = $imgsize[0];
$src_h = $imgsize[1];
$picture = imagecreatetruecolor($Vorschaubreite, $height);
imagealphablending($picture, false);
imagesavealpha($picture, true);
$bool = imagecopyresampled($picture, $image, 0, 0, 0, 0, $Vorschaubreite, $height, $src_w, $src_h);
if($bool){
switch(strtolower(substr($targetFile, -3))){
case \"jpg\":
header(\"Content-Type: image/jpeg\");
$bool2 = imagejpeg($picture,$targetPath.\"Thumbs/$Vorschaubreite_\".$_FILES['Filedata']['name'],$Qualitaet);
break;
case \"png\":
header(\"Content-Type: image/png\");
imagepng($picture,$targetPath.\"Thumbs/$Vorschaubreite_\".$_FILES['Filedata']['name']);
break;
case \"gif\":
header(\"Content-Type: image/gif\");
imagegif($picture,$targetPath.\"Thumbs/$Vorschaubreite_\".$_FILES['Filedata']['name']);
break;
}
}
imagedestroy($picture);
imagedestroy($image);
echo '1'; // Important so upload will work on OSX
}
mysql_query(\"INSERT into Bildergalerie
(Bild,Galerie,User,Datum)
VALUES
('\".sicherheit($_FILES['Filedata']['name']).\"',
'\".sicherheit($_GET['ID']).\"',
'Username',
UNIX_TIMESTAMP());\");
if (!file_exists($_GET['folder'])) {
mkdir (\"../../Bilderalbum/\".$_GET['ID'].\"\", 0755);
mkdir (\"../../Bilderalbum/\".$_GET['ID'].\"/Thumbs\", 0755);
}
Upload($Vorschaubreite,$Qualitaet,$ID);
Upload(400,$Qualitaet,$ID);
Upload(600,$Qualitaet,$ID);
?>
Injected said:hmm, if I open the upload.php with some url parameters the $_GET['ID'] for the mysql insert works.
but if start it with the uploadify script the ID is empty.
'script' : 'classes/upload.php?Vorschaubreite=100&Qualitaet=80&Prozess=Starten&ID=1337',