My site doesn't always load the .xlsx file

http://buscarporcp.rf.gd/

 Error Message ?i=1:1121 Error: SyntaxError: Unexpected token '<', "<html><bod"... is not valid JSON in web Console as error in Network tab response is: html body script type="text/javascript" src="/aes.js" /script script>function toNumbers(d){var e=[];d.replace(/(..)/g,function(d){e.push(parseInt(d,16))});return e}function toHex(){for(var d=[],d=1==arguments.length&&arguments[0].constructor==Array?arguments[0]:arguments,e="",f=0;f<d.length;f++)e+=(16>d[f]?"0":"")+d[f].toString(16);return e.toLowerCase()}var a=toNumbers("f655ba9d09a112d4968c63579db590b4"),b=toNumbers("98344c2eee86c3994890592585b49f80"),c=toNumbers("87942cd0f7921e1316ffc86d8d330d4d");document.cookie="__test="+toHex(slowAES.decrypt(c,2,a,b))+"; expires=Thu, 31-Dec-37 23:55:55 GMT; path=/"; location.href="http://buscarporcp.rf.gd/appf/process_postalreqsinglep.php?search_value=1854&i=1";</script><noscript>This site requires Javascript to work, please enable Javascript in your browser or use a browser with Javascript support</noscript></body></html> 

My site in my own dev environment which is in localhost, loads fine a xlsx file using php script, performs a search and returns three variables, but when on infinityfree subdomain it sometimes works but sometimes is returning the error described earlier, also when switching to mobile on chrome devtools returns the error, i am not an expert on this but i think it has something to do with the i parameter or an intermediary system which is making some checking, my site doesnt work like an API, but always when i send the GET request I need to send the search term, how can I set it to not be confused as an API?

What is making the request?

5 Likes

The request is being produced inside the HTML page to the same domain(infinityfree) where is the server allocated, it is a PHP script, that is why it is not supossed to work like an API, it is a web page which loads data from a backend file, so to use it the page shows a placeholder to search for a term

So? Is it using a supported client?

3 Likes

I dont know, the request is being made from the browser main page of my site using the fetch() API in JavaScript, and it’s directed to the same domain where the server is hosted.
Maybe I need to configure the main PHP script handling the requests to be accessed only trough webpage, but I think another thing is preventing the script to run, I dont know what it is, sometimes it runs, sometimes not, also when switching to mobile view in google dev tools or when switch back to desktop it doesnt work

What browser are you using?

If you need help, write clearly as to what did you do that cause the error to appear. Vague posting will likely be ignored

3 Likes

ok, I am using chrome browser, I really dont know what causes the error, I am doing some changes

Hi I have reached the Hit limit, how many requests can i do per day?, but it says InfinityFree enforces a limit of 50,000 hits in a single day, i didnt reach that number, well maybe taking in account the assets, i really dont know

Please read

6 Likes

ok, I need to know if I can fetch assets and an excel file from a cloud storage service, for example from gdrive using pabbly, does it increase the hints count?, I need to know if there is some ftp client to fetch the assets and file from some cloud storage site

Please read the article that was linked above, it explains what a hit is.

3 Likes

you are right, a hit counts as a request to any site

No. That is not what a hit is. Did you read the article?

2 Likes

I mean any request to a file

I want to try the free hosting to check visits, then to pay premium, but i think that security service is making something I dont understand, in localhost there is no issue with my PHP scripts, and is not infinityfree is that apache security system that many cloud computing services use, does premium allow for direct processing of PHP?

Hits are web requests, not file requests. A single web request can trigger a complex PHP application that imports thousands of different code files, but it’s still just a single hit.

Besides that, I don’t quite understand how your site works, what exactly breaks, and why you keep insisting that they key part is about XLSX files.

To answer your questions to the best of my understanding:

  • Our security system is not “that apache security system that many cloud computing services use”. I don’t know of any provider but us who uses this system, and most cloud providers use very little Apache to begin with. A more common security system would be mod_security, which this is not.
  • Our hosting does “direct processing of PHP”. I don’t fully understand what that means, but premium hosting doesn’t execute PHP in a fundamentally different way.
  • Offloading the spreadsheet to cloud storage when you need to process it with PHP to search with it is a terrible idea. It’s just going to slow down your site a lot for no benefit. Effectively you’re using the spreadsheet as a database, and databases should be close and fast, which cloud storage is not.
  • “But it works on my machine” is not a terribly useful thing to keep stressing when nobody but you has access to your machine.
7 Likes

What i am trying to achieve is to get the data from my xlsx file always, I really dont know why sometimes it works, and sometimes doesnt, in my localhost it works always, is the same code i uploaded, but when turning to mobile or viceversa, when turning to desktop in dev tools it stop working giving me some errors, for example an html page instead of my json object, sometimes i leave the site for 5 minutes and when return and click my button it doesnt work too, and it is not on infinityfree only, the same occurs in other web based apache server websites, i am trying to make a log file as php output to see the error

What are they? We can’t magically tell you how to fix an issue you refuse you give us information on.

Also “ get the data from my xlsx file” provides no information either. Where is this file stored? How are you accessing it? Where is the error occurring? What is the error?

We can’t help you if all you tell us is “it does not work, but it sometimes works, it works there but never works here. Fix it”

6 Likes

Problem solved, the returned HTML was for setting a cookie, it is the security system way to ensure that it’s not an API but the website on server, i am not using infinityfree but other site now until i get my site tomorrow, the other site also uses that security system,

Where is this file stored?

regarding the xlsx file, it is a file within htdocs folder, it is fetched fine by a PHP script, the errors I was getting were because i was not processing the returned html

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.