i had a problem with my php script. im using php to show all my picture in folder "gambar" and then i want to add button command in every picture i've showed to other folder i already make. im using POST syntax and had trouble with it. button show up but not executing command to moving file i've choose. this is script i've use, could somebody help me with this?
<?php
$folder = "gambar"; //folder tempat gambar disimpan
$handle = opendir($folder);
echo '<table cellspacing="5" cellpadding="10" width="90%" >';
echo '<tr>';
$i = 1;
while(false !== ($file = readdir($handle))){
if($file != '.' && $file != '..'){
echo '<td style="border:1px solid #000000;" align="center" >
<div class="hvrbox">
<img src="gambar/'.$file.'" alt="Mountains" class="hvrbox-layer_bottom"
width="100%" />
<div class="hvrbox-layer_top">
<div class="hvrbox-text"> '.$file.'.</div>
</div>
</div>
<script type="text/javascript" src="js/jquery-1.11.3.min.js"></script>
<script type="text/javascript" src="js/hover-box.js"></script>
</select>
<form method="post">
<input type="hidden" select name="datae" value="'.$file.'" />
>>> <input type="submit" name="upload" value="Upload" />
---
<input type="submit" name="delete" value="Delete" /><<<
</form>
<br /><b>NAMA FILE:</b> '.$file.'</td>';
if(($i % 1) == 0){
echo '</tr><tr>';
}
$i++;
}
}
echo '</tr>';
echo '</table>';
?>
and to progress POST im using this script
<?php
// Turn off all error reporting
error_reporting(0);
if (isset($_POST['upload']) && isset($_POST['datae'])) {
rename('gambar/'.$_POST['datae'], 'Upload/'.$_POST['datae']);
echo "<meta http-equiv='refresh' content='1'>";
}
if (isset($_POST['delete']) && isset($_POST['datae'])) {
rename('gambar/'.$_POST['datae'], 'delete/'.$_POST['datae']);
echo "<meta http-equiv='refresh' content='1'>";
}
?>
cz when i use
<form method="post">
<input type="hidden" select name="datae" value="'.$file.'" />
so did
($_POST['datae']
still not moving the files to other folder, its like the script was working but no files moved to destination folder.
PS. im sorry cz my English is BAD. but i wish you could understand what i mean.