Categories > Coding > PHP >
file_put_contents() not doing anything
Posted
Hi, so what I am trying to do, is when a user posts "?addkey", it adds the given key to a file in "database/keys.json".
And when I am trying to add a key, it doesn't do anything at all. What is the problem?
Using a localhost, so the updates should occur immediatelly.
Code:
## The code for the add key, I know it has a else if, I just posted this part of my code
# So no one would copy
else if($_GET["addkey"] != ""){
$content = $_GET["addkey"];
file_put_contents("database/keys.json", ", " + $content);
}
I also tried:
else if($_GET["addkey"]){
$content = $_GET["addkey"];
file_put_contents("database/keys.json", ", " + $content);
}
Yet nothing worked.
Any help would be appreciated.
Random quote here...
Replied
@67078L plus ratio
L php
W nodejs ,Express
Cancel
Post
https://cdn.discordapp.com/attachments/661621789591470090/1013919752294498314/Untitled_1366_768_px_1546_202_px_2.gif
"Questionable intellegence, but I like the mystery" - CubeFaces
https://cdn.discordapp.com/attachments/1136067487847415848/1138948596679589898/sig.png
Replied
@pepsi this is my selection so stop hating php, plus i am 100% wrrd was also made in php
Cancel
Post
Random quote here...
Replied
@VoidableMethod : L you L wrd L php L expressjs
no wonder why there so much vulns LOL.
Cancel
Post
https://cdn.discordapp.com/attachments/661621789591470090/1013919752294498314/Untitled_1366_768_px_1546_202_px_2.gif
Replied
@pepsi L you + ratio + no one asked + didn't ask + goofy ahh 💀 + bruh moment + skid moment
Cancel
Post
Random quote here...
Replied
is- is that your attempt at implementing a database???????
Cancel
Post
https://cdn.discordapp.com/attachments/1023423265160560745/1132948683747500092/Frame_12x.png
Replied
why tf u using php 💀💀
please for the love of god use nodejs + express
Cancel
Post
Replied
@kyron I just wanted to learn a new programming language, PHP was the one I selected. Plus, I know Node.JS and how to use Express, so I might use it later. As for now I will use PHP.
Cancel
Post
Random quote here...
Replied
@67078for the love of god use mysql or mongodb
Cancel
Post
https://cdn.discordapp.com/attachments/1023423265160560745/1132948683747500092/Frame_12x.png
Replied
@RiceUsesArchBtw as I said, this is my project, I choose what I code and what I use.
Cancel
Post
Random quote here...
Replied
The guy's asking help in the right section for this post and all the majority can do is to tell him to use a different resource? Not sure if this is actually helping him solve his problem. He started php for a reason, no need to force him out of his current decision.
Cancel
Post
https://cdn.discordapp.com/attachments/995469995742068832/1073019970012848228/Untitled39_20220604185345.png
Replied
@VoidableMethod Looks like nobody should ever use your project if you don't care about security. It's insecure and blatantly wrong. Data should never be stored in a publicly accessible file whether it's keys or personal information. Bad practice.
Cancel
Post
Replied
@67078and i can criticize you how insecure your implementation is. stop being ignorant.
Cancel
Post
https://cdn.discordapp.com/attachments/1023423265160560745/1132948683747500092/Frame_12x.png
Users viewing this thread:
( Members: 0, Guests: 1, Total: 1 )
Cancel
Post