The only problem is when I type mywebsite.com/database.json it shows the database. That means anyone with that URL can access the database and read everything written inside it.
Is it possible to somehow forbid access to the database file unless it’s from inside my app? I want it to be readable only from my app’s users.
I don’t know much about the .htaccess file but after some research I discovered that I can password protect a page of my website or a single file and when someone tries to view it a dialog pops up on the browser and asks for Username & Password. But apart from that I don’t know how to use the TinyWebDB Component when the directory is locked. Do I have to use the Web Component with POST and GET?
(Note: I haven’t locked the file yet because it requires premium hosting plan which I’ll buy in a few days)
Now that I’ve added this in the .htaccess file I get an error because I have the free plan which does not support Password Protection if I’m not mistaken
The error I get:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator at [no address given] to inform them of the time this error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error log.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
I read that 000webhost got hacked some time ago and also I wasn’t satisfied with the uptime when I was testing a website there. Now awardspace has a promo offer of just 1€ for the first year and it’s perfect for testing my app when I publish it on playstore. If it goes well I will buy better services but for now I’d rather not spend much money.
How did you accomplish that without a password? Was it via the .htaccess file as well?
Now that I see it again, am I wrong or does the free plan give you 10GB of bandwidth & 1GB of storage? That’s really cool actually, with so much bandwidth I’ll probably not have to go premium.
that’s why i am using it there bandwidth is amazing for free plan. plus you can double the amount of bandwidth and storage as they allow 2 websites. so i use this trick whenever my bandwidth of first website get exhuasted i change the services url of tiny db by firebase to my other website. hence i enjoy 20gb of bandwidth.
Aren’t those the files from Diego’s tutorial? I had already uploaded the storevalue.php getvalue.php .htaccess
but the database file extension was .json. Now that it is .txt its working fine! Thanks for the help! It worked