Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

284
Views
Obteniendo un error 404 al intentar ejecutar la página html

Estoy tratando de enviar una cadena de PHP a una variable en JSON. Pero cada vez que se carga la página, aparece un error de recurso 404 por algún motivo. No entiendo qué está pasando y por qué sigo recibiendo este error. Recibo el error después de que la página web ejecuta la parte del script del código. La forma en que revisé esto fue usando el kit de desarrollo en Google Chrome.

Estoy ejecutando PHP a través de Microsoft IIS.

ObtenerInfoArchivo.php

 <?php //Calls the getFileInfoMainFunction getFileInfoMainFunction(); //Function : sscaddir //Parameters : $dir //Returns : array //Description : This function takes an array where we get rid of the dots function sscandir($dir) { return array_values(array_diff(scandir($dir),array('..','.'))); } function getFileInfoMainFunction(){ //variables $implodedFilesEqual; $toJson; //C:\localwebiste\holmes-e-joesph-r $fileDirectory=dirname(__FILE__); //now we are in the MyFilesDirectory $fileDirectory.="\MyFiles"; //store all the files in the filedirectory in an array $files=sscandir($fileDirectory); //The '|' delimter //This is the string that we will send too the client side code. $implodedFilesEqual=implode("|",$files); //For testing purpose print_r($files); $toJson=json_encode($implodedFilesEqual); echo ($implodedFilesEqual); //Test.txt|test3.txt } ?>

página HTML:

 <html> <head> <title>Starting Page</title> <link rel="stylesheet" href="StartPage.css" media="screen"> <script src="https://ajax.googleeapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> <script src="jQuery.js"></script> </head> <body id="theTextEditorsBody"> <p id="demo"></p> <h1>Text Editor</h1> <hr> <textarea id="textArea"></textarea> <br> <select> <option>textFile1</option> <option>textFile2</option> <option>textFile3</option> </select> <p id="hello"></p> </body>

jQuery.js:

 const xmlhttp=new XMLHttpRequest(); xmlhttp.onload=function(){ const myObj=JSON.parse(this.responseText); document.getElementById("demo").innerHTML=myObj.name; } xmlhttp.open("POST","GettingFileInfo.php"); xmlhttp.send();
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!