![]() |
|
Image Gallery Upload failed - Printable Version +- ZenphotoCMS Forum (https://forum.zenphoto.org) +-- Forum: Support (https://forum.zenphoto.org/forum-1.html) +--- Forum: General support (https://forum.zenphoto.org/forum-4.html) +--- Thread: Image Gallery Upload failed (/thread-8156.html) |
Image Gallery Upload failed - simy202 - 2011-01-26 Hi, This is probably a simple question, however I am finding it difficult to accomplish. <?php $upload = new upload(); $upload->upload_file(); ?> so in a test page it would be like so: <?php $upload = new upload(); $upload->upload_file(); ?> <form action="" method="post" enctype="multipart/form-data"> <input type="file" id="real_upload" class="hide" name="file" /> <input type="submit" id="real_submit" class="hide" value="Upload" /> </form> The problem is I'm using this upload system for parts of the website, what I want is to have this class upload the file once it has gone through the "gallery upload" segment: <?php $mysql_link = mysql_connect("localhost", "", ""); mysql_select_db("") or die("Could not select database"); while($counter <= count($photos_uploaded)) { if($photos_uploaded['size'][$counter] > 0) { if(!array_key_exists($photos_uploaded['type'][$counter], $known_photo_types)) { $result_final .= "File ".($counter+1)." is not a photo"; } else { mysql_query( "INSERT INTO gallery_photos(`photo_filename`, `photo_caption`, `photo_category`) VALUES('0', '".addslashes($photo_caption[$counter])."', '".addslashes($_POST['category'])."')" ); $new_id = mysql_insert_id(); $filetype = $photos_uploaded['type'][$counter]; $extention = $known_photo_types[$filetype]; $filename = $new_id.".".$extention; mysql_query( "UPDATE gallery_photos SET photo_filename='".addslashes($filename)."' WHERE photo_id='".addslashes($new_id)."'" ); } ?> How would I approach this PHP Image Gallery (Upload Problem)? Thanks Image Gallery Upload failed - acrylian - 2011-01-26 Zenphoto features its own uploader (actually two one flash based multifile upload and a html single file upload) and additionally you can upload directly via FTP as well. |