0

hi all,
i had a image upload code and it is working fine but while uploading i need some progress bar. so i got some progress bars..so can any one suggest me how to integrate that progress bar in my code...Is there any examples...
Thank u.

2
Contributors
4
Replies
5
Views
6 Years
Discussion Span
Last Post by muralikalpana
0
<?
$total_width = 600;

// base color
$base_color = 'silver';

// add an array per field to show
$graphs = array(
array('label'=>'whatever', 'color'=>'red', 'amount'=>'28'),
array('label'=>'more here', 'color'=>'green', 'amount'=>'36'),
array('label'=>'just an example', 'color'=>'blue', 'amount'=>'82'),
array('label'=>'even more', 'color'=>'orange', 'amount'=>'4'),
);

for($x = 0; $x < count($graphs); $x++)
{
    echo '
<table width="'.$total_width.'">
    <tr>
        <td colspan="2">
            '.$graphs[$x]['label'].'
        </td>
    </tr>
    <tr>
        <td width="'.$graphs[$x]['amount'].'%" bgcolor="'.$graphs[$x]['color'].'">
             '.$graphs[$x]['amount'].'%
        </td>
        <td width="'.(100-$graphs[$x]['amount']).'%" bgcolor="'.$base_color.'">
             &nbsp;
        </td>
    </tr>
</table>';
} 
?>
0

hey thanks for ur response..but wer shall i keep this code..?

<?php include 'header.php';
?>
<?php
$max_no_img=4; // Maximum number of images value to be set here

echo "<form method=post action=fileupload.php enctype='multipart/form-data'>";
echo "<table border='0' width='400' cellspacing='0' cellpadding='0' align=center>";
for($i=1; $i<=$max_no_img; $i++){
echo "<tr><td>Images $i</td><td>
<input type=file name='images[]' class='bginput'></td></tr>";
}

echo "<tr><td colspan=2 align=center><input type=submit name=submit value='Upload'></td></tr>";
echo "</form> </table>"; 

if(isset($_POST['submit']))
    {
while(list($key,$value) = each($_FILES[images][name]))
{
if(!empty($value)){   // this will check if any blank field is entered
$filename = $value;    // filename stores the value

$filename=str_replace(" ","_",$filename);// Add _ inplace of blank space in file name, you can remove this line

$add = "images/$filename";   // upload directory path is set
//echo $_FILES[images][type][$key];     // uncomment this line if you want to display the file type
// echo "<br>";                             // Display a line break
copy($_FILES[images][tmp_name][$key], $add);     //  upload the file to the server
chmod("$add",0777);                 // set permission to the file.
}

}
 echo "Your Images Uploaded";   
    }
    ?>
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.