blueimp/jQuery-File-Upload — Issue #789: jQuery File Upload And GET  PHP MySQL
Author: hugocastalleda
Created: 2011-11-15 15:01:56+00:00
State: open

I have in sigueinte code and works only with $ _POST but I want to receive & _GET but not and how to do that by changing the $ _POST to $ _GET shows error ie $ Lant = $ _POST ['test'], and by placing the $ Lant = $ _GET ['test'] I get error anyone can help me

upload.php

private function handle_file_upload($uploaded_file, $name, $size, $type, $error) {
$file = new stdClass();
$file->name = $this->trim_file_name($name, $type);
$file->size = intval($size);
$file->type = $type;
//$file->tite = $title;
$error = $this->has_error($uploaded_file, $file, $error);
if (!$error && $file->name) {
$file_path = $this->options['upload_dir'].$file->name;
$append_file = !$this->options['discard_aborted_uploads'] &&
is_file($file_path) && $file->size > filesize($file_path);
clearstatcache();
if ($uploaded_file && is_uploaded_file($uploaded_file)) {
// multipart/formdata uploads (POST method uploads)
if ($append_file) {
file_put_contents(
$file_path,
fopen($uploaded_file, 'r'),
FILE_APPEND
);
} else {
move_uploaded_file($uploaded_file, $file_path);

//conexion
$casa=$_POST['title'];
$username="root";
$password="";
$database="google_maps";
$connection = mysql_connect ("localhost", $username, $password);
if (!$connection) {
die('Not connected : ' . mysql_error());
}
// conexion MySQL
$db_selected = mysql_select_db($database, $connection);
if (!$db_selected) {
die ('Can\'t use db : ' . mysql_error());
}
// Insert new row with user data
$query = sprintf("INSERT INTO markers " .
" (id, name, address ) " .
" VALUES (NULL, '%s', '%s');",
mysql_real_escape_string($file->name),
mysql_real_escape_string($casa));
$result = mysql_query($query);
//fin the conexion

}
} else {
// Non-multipart uploads (PUT method support)
file_put_contents(
$file_path,
fopen('php://input', 'r'),
$append_file ? FILE_APPEND : 0
);
}
$file_size = filesize($file_path);
if ($file_size === $file->size) {
$file->url = $this->options['upload_url'].rawurlencode($file->name);
foreach($this->options['image_versions'] as $version => $options) {
if ($this->create_scaled_image($file->name, $options)) {
$file->{$version.'_url'} = $options['upload_url']
.rawurlencode($file->name);
}
}
} else if ($this->options['discard_aborted_uploads']) {
unlink($file_path);
$file->error = 'abort';
}
$file->size = $file_size;
$file->delete_url = $this->options['script_url']
.'?file='.rawurlencode($file->name);
$file->delete_type = 'DELETE';
} else {
$file->error = $error;
}
return $file;
}