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.
Replied
Did you see if that chunk of code even executed? Also PHP is crappy ;-;
4b5951d5-1b9b-407b-b514-78eb46591564
Replied
@RealNickk it isn't tho
Replied
https://cdn.discordapp.com/attachments/670416717012271165/987924580691763220/Untitled_1366_768_px_1546_202_px_1.gif
Replied
@pepsi W pepsi
4b5951d5-1b9b-407b-b514-78eb46591564
Replied
@RealNickk W delete entire repo
Replied
@pepsi this is my selection so stop hating php, plus i am 100% wrrd was also made in php
Replied
@Aja : L you L wrd L php L expressjs
no wonder why there so much vulns LOL.
https://cdn.discordapp.com/attachments/670416717012271165/987924580691763220/Untitled_1366_768_px_1546_202_px_1.gif
Replied
@pepsi L you + ratio + no one asked + didn't ask + goofy ahh 💀 + bruh moment + skid moment
Replied
@Aja i asked
4b5951d5-1b9b-407b-b514-78eb46591564
Replied
is- is that your attempt at implementing a database???????
uhh full steak dev
too busy with school
nodejs is yes
Replied
why tf u using php 💀💀
please for the love of god use nodejs + express
RIP ABV2 - 2018 - 2022
Amazing people who have repped me - https://pastebin.com/1ju2S3q2
https://cdn.discordapp.com/attachments/901227777741692968/985854850678018058/IMG_4712.png
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.
Replied
@Ajafor the love of god use mysql or mongodb
uhh full steak dev
too busy with school
nodejs is yes
Replied
@CrackerIsHere as I said, this is my project, I choose what I code and what I use.
Users viewing this thread:
( Members: 0, Guests: 1, Total: 1 )