Categories > Coding > PHP >

file_put_contents() not doing anything


Aja

Zenexya#2964

Posts: 1079

Threads: 121

Joined: Apr, 2021

Reputation: -1

  • 0

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.

RealNickk

am h3x0r

patron

Posts: 3053

Threads: 147

Joined: Feb, 2020

Reputation: 35

  • 0

Replied

Did you see if that chunk of code even executed? Also PHP is crappy ;-;

4b5951d5-1b9b-407b-b514-78eb46591564

Aja

Zenexya#2964

Posts: 1079

Threads: 121

Joined: Apr, 2021

Reputation: -1

  • 0

Replied

@RealNickk it isn't tho

pepsi

PePsIDeveloper

patron

Posts: 241

Threads: 10

Joined: Apr, 2021

Reputation: 1

  • 0

Replied

@AjaL plus ratio

L php

W nodejs ,Express

 

 

https://cdn.discordapp.com/attachments/670416717012271165/987924580691763220/Untitled_1366_768_px_1546_202_px_1.gif

RealNickk

am h3x0r

patron

Posts: 3053

Threads: 147

Joined: Feb, 2020

Reputation: 35

  • 0

Replied

@pepsi W pepsi

4b5951d5-1b9b-407b-b514-78eb46591564

SeizureSalad

i love femboys

Posts: 488

Threads: 21

Joined: Mar, 2021

Reputation: 12

  • 0

Replied

@RealNickk W delete entire repo

Aja

Zenexya#2964

Posts: 1079

Threads: 121

Joined: Apr, 2021

Reputation: -1

  • 0

Replied

@pepsi this is my selection so stop hating php, plus i am 100% wrrd was also made in php

 

pepsi

PePsIDeveloper

patron

Posts: 241

Threads: 10

Joined: Apr, 2021

Reputation: 1

  • 0

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

Aja

Zenexya#2964

Posts: 1079

Threads: 121

Joined: Apr, 2021

Reputation: -1

  • 0

Replied

@pepsi L you + ratio + no one asked + didn't ask + goofy ahh 💀 + bruh moment + skid moment

RealNickk

am h3x0r

patron

Posts: 3053

Threads: 147

Joined: Feb, 2020

Reputation: 35

  • 0

Replied

@Aja i asked

4b5951d5-1b9b-407b-b514-78eb46591564

CrackerIsHere

rice cracker

Posts: 121

Threads: 4

Joined: Aug, 2021

Reputation: 8

  • 0

Replied

is- is that your attempt at implementing a database???????

uhh full steak dev

too busy with school

nodejs is yes

Posts: 424

Threads: 26

Joined: Aug, 2021

Reputation: 18

  • 0

Replied

why tf u using php 💀💀

please for the love of god use nodejs + express

Aja

Zenexya#2964

Posts: 1079

Threads: 121

Joined: Apr, 2021

Reputation: -1

  • 0

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.

CrackerIsHere

rice cracker

Posts: 121

Threads: 4

Joined: Aug, 2021

Reputation: 8

  • 0

Replied

@Ajafor the love of god use mysql or mongodb

 

uhh full steak dev

too busy with school

nodejs is yes

Aja

Zenexya#2964

Posts: 1079

Threads: 121

Joined: Apr, 2021

Reputation: -1

  • 0

Replied

@CrackerIsHere as I said, this is my project, I choose what I code and what I use.


Next >>>

Users viewing this thread:


( Members: 0, Guests: 1, Total: 1 )