ggalan
08-30-2011, 07:23 PM
im using this tutorial to make a re-arranging sql dB based on jQuery.
http://teamtutorials.com/web-development-tutorials/using-jquery-to-reorder-a-list-and-update-a-database
my question is how would i have an upload image button to work with this type of system?
i know what i am asking is a lot so i dont expect anyone to do the work or anything but just a conversation or maybe a point in direction on how this type of task could be achieved.
this is part of my upload code that works well but im stuck trying to integrate the 2
<?
$directory_self = str_replace(basename($_SERVER['PHP_SELF']), '', $_SERVER['PHP_SELF']);
$uploadsDirectory = $_SERVER['DOCUMENT_ROOT'] . $directory_self . 'uploaded_files/';
$uploadForm = 'http://' . $_SERVER['HTTP_HOST'] . $directory_self . 'index.php';
$uploadSuccess = 'http://' . $_SERVER['HTTP_HOST'] . $directory_self . 'index.php';
// name of the fieldname used for the file in the HTML form
$fieldname = 'file';
$uploadFilename = $uploadsDirectory . $_FILES[$fieldname]['name'];
$_SESSION['fileName'] = $_FILES[$fieldname]['name'];
@move_uploaded_file($_FILES[$fieldname]['tmp_name'], $uploadFilename);
//or error('receiving directory insuffiecient permission', $uploadForm);
header('Location: ' . $uploadSuccess);
?>
http://teamtutorials.com/web-development-tutorials/using-jquery-to-reorder-a-list-and-update-a-database
my question is how would i have an upload image button to work with this type of system?
i know what i am asking is a lot so i dont expect anyone to do the work or anything but just a conversation or maybe a point in direction on how this type of task could be achieved.
this is part of my upload code that works well but im stuck trying to integrate the 2
<?
$directory_self = str_replace(basename($_SERVER['PHP_SELF']), '', $_SERVER['PHP_SELF']);
$uploadsDirectory = $_SERVER['DOCUMENT_ROOT'] . $directory_self . 'uploaded_files/';
$uploadForm = 'http://' . $_SERVER['HTTP_HOST'] . $directory_self . 'index.php';
$uploadSuccess = 'http://' . $_SERVER['HTTP_HOST'] . $directory_self . 'index.php';
// name of the fieldname used for the file in the HTML form
$fieldname = 'file';
$uploadFilename = $uploadsDirectory . $_FILES[$fieldname]['name'];
$_SESSION['fileName'] = $_FILES[$fieldname]['name'];
@move_uploaded_file($_FILES[$fieldname]['tmp_name'], $uploadFilename);
//or error('receiving directory insuffiecient permission', $uploadForm);
header('Location: ' . $uploadSuccess);
?>