Hello.
I don't know how to use AJAX.
Can someone please help me?
I'm using an iframe to display percentage of file uploaded. The iframe refreshes itself every 2.5 seconds. It's okay for now, but not a practical solution.
I need iframe to refresh but, it shouldn't look like its refreshing (using AJAX).
You can see a live example: http://mintload.com/upload/upload-single.php
(Choose a sample file, click "Upload")
Code for iframe fileprog.php (php+js):
<?php
//Code for calculating percentage excluded from this post,not required.
//Here's where JS comes into use:
echo sprintf('<script>setTimeout( function(){location.href="%s?sid=%s&cb=%s"} ,2500);</script>',$_SERVER['PHP_SELF'], $sessionid, time());
echo "<font face='Verdana' color='#00CED1' style='font-size:24pt; font-weight:bold;'>".$percent_done."% </font><br><font face='Verdana' style='font-size:14pt' color='lightblue'>uploaded</font>";
?>
Thank you.