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 6210665
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T06:12:00+00:00 2026-05-24T06:12:00+00:00

I am listing files from a directory and for each one there is a

  • 0

I am listing files from a directory and for each one there is a delete link, in firefox all works but with chrome when I want to display the list, I get this error, I dont know how to fix it

This page contains the following errors:

error on line 4 at column 44: Opening and ending tag mismatch: root line 0 and br
Below is a rendering of the page up to the first error.

this is my script:

<script type="text/javascript">

window.addEvent('domready', function() {
    $$('a.delete').addEvent('click', function(e) {
        e.stop();
        var id = this.get('id');
        var DeleteFile = new Request({
//            method: 'POST',
//            data: 'archivo='+id,
            url: 'deletefile.php?archivo='+id,
            onRequest: function() {},
            onSuccess: function(text, xmlanswer) {
                //alert(text);
            $('page_container').load('script2.php');
            },
            onFailure: function(){alert('Error!');}
    }).send();
//        DeleteFile.send({ data: { 'archivo': id } });
    });
});
</script>


<?php

$ruta = "./uploadedfiles/";
$directorio = dir($ruta);
$types = array('jpg', 'jpeg', 'txt', 'gif', 'png', 'doc', 'docx', 'pdf', 'xlsx', 'pptx');
$identificador = "";


while ($archivo = $directorio->read()) {
    $division = explode(".", $archivo);
    $extension = end($division);
    $identificador = $archivo;


   if(in_array($extension, $types)){

      echo $archivo . "<a id=\"". urlencode($identificador)."\" href=\"#\" class=\"delete\">Delete</a></br>";


//echo $archivo . "&nbsp;<a id=\"". $identificador."\" href=deletefile.php?archivo=" . urlencode($archivo) .">Delete</a><br>";
      //echo $archivo. "<a id=refresh href=# >Delete</a><br> ";

   }

}

$directorio->close();
?>
  • 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-05-24T06:12:01+00:00Added an answer on May 24, 2026 at 6:12 am

    Your <br> and </br> tags are both wrong and mismatched.

    The <br /> tag cannot have content; you should always make it a self-closing tag (<br />)

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

Sidebar

Related Questions

Is it possible to download all the files from a directory listing? Eg., the
I'm listing the data from one of my models in a table <% @events.each
Quick question. I have a listbox being populated from a directory listing. Each file
I would like to prevent Tomcat from listing the files in a directory when
I have a file created from a directory listing. From each of item a
I wish to read files from a directory and iteratively perform an operation on
In another question - Getting directory listing from SVN for use in ANT dropdown
I'm trying to get a list of all mp3 files in a directory (the
I'm trying to get a directory listing of files on an ftp server using
I've placed a set of .rb files in a directory modules/ . Each of

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.