Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9133023
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:24:52+00:00 2026-06-17T08:24:52+00:00

Can someone spot the error in this code it is not displaying the upload

  • 0

Can someone spot the error in this code it is not displaying the upload progress.

<form action="upload.php" method="post" enctype="multipart/form-data">
<center><p> <input type='file' id='upload_id' size='58' style='height: 30px; font-size: 18px' name='filename'></p>
<input type='image' src='<?php echo $menu_upload_button; ?>' onclick="function set() { f=document.getElementById('progress_iframe'); f.style.display='block'; f.src='uploadprogress.php?id=<?=$upload_id?>';} setTimeout(set);">
<iframe id="progress_iframe" src="" style="display:none;" scrolling="no" frameborder="0"></iframe>
</form>

the function from the input is this:

function set() { 
   f=document.getElementById('progress_iframe'); 
   f.style.display='block'; 
   f.src='uploadprogress.php?id=<?=$upload_id?>';
} 
setTimeout(set);

uploadprogress.php:

<META HTTP-EQUIV='REFRESH' CONTENT='1;URL=?id=<?=$_GET['id']?>'>
Upload progress:<br />
<?php
    if(!$_GET['id']) die;
    $info = uploadprogress_get_info($_GET['id']);
    $kbytes_total = round($info['bytes_total'] / 1024);
    $kbytes_uploaded = round($info['bytes_uploaded'] / 1024);
    echo $kbytes_uploaded.'/'.$kbytes_total.' KB';
?>

Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T08:24:53+00:00Added an answer on June 17, 2026 at 8:24 am

    for starters, I’d suggested you rework using $_GET[‘id’] in your HTML, as that’s a vector for a security breach (hitting that URL and passing in some nasty stuff). Perhaps check for an integer and sanitize that way the response from $_GET[‘id’].

    Also, if I may suggest, if you’re connecting to the same site that you eliminate the iframe, as you can update in place elements on your page through ajax without the use of an iframe (which will be faster and more efficient, as it won’t have to load a full page every time).

    If you keep this method, though, your javascript function will never end on your page, as your timeout function never has an end. You can do so with something like:

    var timer = setTimeout(
    clearTimeout(timer);
    

    A quick guess is that uploadprogress.php is in a different directory and you’re giving it a relative URL instead of a full url. Try switching that (if it was in the htdocs/foo/bar dir on your server, set it to /foo/bar/uploadprogress.php

    Finally, the time parameter in setTimeout is required. You’ll need to include that. Pop in a console.log or an alert in your setFunction to help you see how often that function is being called.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hopefully, someone can spot the error, what I need to do is to first
Can someone spot the problem with this implementation? I can open it up in
can someone tell me what seems to be the issue with this <?php $increment
Getting a NullPointerException when calling method fillDBWeek(String mName). I can not spot where I
I am struggling with preg_replace and am really hoping someone can spot my error.
I wonder if someone can help spot the error for me. I'm pretty new
Can you spot the error in the code? tickets ends up going below 0
This may be too obscure a question, but perhaps someone can spot what I'm
I'm not sure why am I getting this strange result. Can someone please shed
Can someone thoroughly explain the last line of the following code: def myMethod(self): #

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.