Jump to content
[MUST READ] Forum Rules ×

Read a text file


Recommended Posts

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 11

Warning: 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 by jon
Link to comment
Share on other sites

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 11

Warning: 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

Link to comment
Share on other sites

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 11

Warning: 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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...