salve gente, sto utilizzando un multiuploader (fancy upload) ovviamente funziona, ho bisogno però di mandare il file uploadato in una determinata categoria (lo faccio via db)
ho questo
Codice PHP:
<form action="script.php" method="post" enctype="multipart/form-data" id="form-demo"> <fieldset id="demo-fallback"> <label for="demo-photoupload"> Upload Photos: <input type="file" name="photoupload" id="demo-photoupload" /> </label> </fieldset> <?php include("config.php"); $query = "SELECT * FROM categorie"; $result = mysql_query($query) ; echo '<select id="cat"> '; while($row = mysql_fetch_array($result)){ printf("<option value=\"%d\">%s</option>", $row["iD"], $row["nome"]); } echo '</select>'; ?> <div id="demo-status" class="hide">
[url="#"]Browse Files[/url] | [url="#"]Clear List[/url] | [url="#"]Upload[/url] </p> <div> <strong class="overall-title">Overall progress[/b]
[img]./assets/progress-bar/bar.gif[/img] </div> <div> <strong class="current-title">File Progress[/b]
[img]./assets/progress-bar/bar.gif[/img] </div> <div class="current-text"></div> </div> <ul id="demo-list">[/list]</form>
poi da ho nel file js
codice:
$('demo-upload').addEvent('click', function() { swiffy.upload(); return false; });
la funzione swiffy.upload(); presa da qui
Codice PHP:
Swiff.Uploader = new Class({ Extends: Swiff, Implements: Events, options: { path: 'Swiff.Uploader.swf', multiple: true, queued: true, typeFilter: null, url: null, method: 'post', data: null, fieldName: 'Filedata', target: null, height: '100%', width: '100%', callBacks: null },..............................upload: function(options){ var current = this.options; options = $extend({data: current.data, url: current.url, method: current.method, fieldName: current.fieldName, options); if ($type(options.data) == 'element') options.data = $(options.data).toQueryString(); return this.remote('upload', options); },
come mando il valore della combo box al file script.php così da poterlo inviare al database come variabile?
sto impazzendo