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.

To see iframe in detail. In Mozilla Firefox, while upload progress is being displayed, right click->This Frame->Open frame in new tab
(And u'll only see iframe + its URL in address bar)

Thank you.

I really need it. Any source/link is welcome too!

Thank you!

Ok, since I urgently need it. I'm requesting one last time..

Someone please help me with it.

Thank you

Akshay

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.