jon Posted June 18, 2018 Share Posted June 18, 2018 (edited) Hi, I have a php script that opens a text file saved in Files folder on website, extracts some data, and then stores it in a SQL data base. Works great on local machine, but when loaded to byethost32 free servers, wont extract any data. I've tried both .html and .txt extensions (html is what I really want to end up with) but is returning blank variables. It has found the file ( I put an error trap in the code to message if it cant find it) just wont extract anything. new 2.txtnew 2.txt I turned on error messages and get this …. Warning: filesize(): stat failed for https://www.xxxxxx.byethost32.com/FILES/DOC.txt in /home/vol7_4/byethost32.com/xxxxxxx/htdocs/filehandling.php on line 11Warning: fread(): Length parameter must be greater than 0 in /home/vol7_4/byethost32.com/xxxxxxx/htdocs/filehandling.php on line 11 Any tips on this? Thanks in advance Edited June 18, 2018 by jon Quote Link to comment Share on other sites More sharing options...
AA22Dev Posted June 18, 2018 Share Posted June 18, 2018 2 hours ago, jon said: Hi, I have a php script that opens a text file saved in Files folder on website, extracts some data, and then stores it in a SQL data base. Works great on local machine, but when loaded to byethost32 free servers, wont extract any data. I've tried both .html and .txt extensions (html is what I really want to end up with) but is returning blank variables. It has found the file ( I put an error trap in the code to message if it cant find it) just wont extract anything. new 2.txtnew 2.txt I turned on error messages and get this …. Warning: filesize(): stat failed for https://www.xxxxxx.byethost32.com/FILES/DOC.txt in /home/vol7_4/byethost32.com/xxxxxxx/htdocs/filehandling.php on line 11Warning: fread(): Length parameter must be greater than 0 in /home/vol7_4/byethost32.com/xxxxxxx/htdocs/filehandling.php on line 11 Any tips on this? Thanks in advance Are you using Localhost as your database hostname then change it to the database hostname provided by byethost Quote Link to comment Share on other sites More sharing options...
mike Posted June 18, 2018 Share Posted June 18, 2018 3 hours ago, jon said: Hi, I have a php script that opens a text file saved in Files folder on website, extracts some data, and then stores it in a SQL data base. Works great on local machine, but when loaded to byethost32 free servers, wont extract any data. I've tried both .html and .txt extensions (html is what I really want to end up with) but is returning blank variables. It has found the file ( I put an error trap in the code to message if it cant find it) just wont extract anything. new 2.txtnew 2.txt I turned on error messages and get this …. Warning: filesize(): stat failed for https://www.xxxxxx.byethost32.com/FILES/DOC.txt in /home/vol7_4/byethost32.com/xxxxxxx/htdocs/filehandling.php on line 11Warning: fread(): Length parameter must be greater than 0 in /home/vol7_4/byethost32.com/xxxxxxx/htdocs/filehandling.php on line 11 Any tips on this? Thanks in advance Depending on how your script works, it might be being blocked by the anti-bot system Quote Link to comment Share on other sites More sharing options...
jon Posted June 18, 2018 Author Share Posted June 18, 2018 1 hour ago, Aqib said: Are you using Localhost as your database hostname then change it to the database hostname provided by byethost Have changed all the settings to the details provided, but its not even getting to database part of script (That's later when I write the data I pick out of the TXT file). Its a text file saved in my FILES folder. Another script I have reads the db without any issues. Quote Link to comment Share on other sites More sharing options...
jon Posted June 18, 2018 Author Share Posted June 18, 2018 18 minutes ago, mike said: Depending on how your script works, it might be being blocked by the anti-bot system How would I find that out? (anti bot) Quote Link to comment Share on other sites More sharing options...
mike Posted June 18, 2018 Share Posted June 18, 2018 8 hours ago, jon said: How would I find that out? (anti bot) Explain further your script. Is it automatic ? Does it need a user active on the page to work ?... Quote Link to comment Share on other sites More sharing options...
jon Posted June 18, 2018 Author Share Posted June 18, 2018 Thanks for the tips, worked it out. Was in fact the variable for the filename ... https://www.xxxxxxxxxx.byethost32.com/FILES/DOC.txt should have just been "./FILES/DOC.txt" Works perfect now. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.