Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Store data without a database?

If I would like to store emails, but don't have a database (e.g. MySQL), what should I do?

The data should be accessible and writable from PHP, but regular "visitors" MUST NOT see the data.

Hope you can help.

like image 756
Mikkel Avatar asked Mar 20 '26 16:03

Mikkel


2 Answers

You can put them in files :)

$data; // Defined "somewhere"
file_put_contents('filename.txt', $data);

However, I suggest you to use a database anyway. At least SQLite is installed nearly everywere.

like image 138
KingCrunch Avatar answered Mar 23 '26 04:03

KingCrunch


If your data not very large, you can use XML files. But if your data is important and you must secure it , you have to encrypt your data

like image 36
Harsh Avatar answered Mar 23 '26 04:03

Harsh



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!