Z
Z
Zorroti2021-06-22 13:45:20
PHP
Zorroti, 2021-06-22 13:45:20

How to save HTML form content to txt file on server side?

Hello. I decided to write some kind of site, I figured out everything related to html, but I just can’t figure out how to save the contents of the file to a txt file, and so that it is saved on the server side

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dyusha Metelkin, 2021-06-22
@Neobezatelno

well done what the phishing site did and wrote about it here, you should not continue working on it because the part that does not sit behind aluminum pans sits behind phishing sites, and with your skills you will not go far

N
Nadim Zakirov, 2021-06-22
@zkrvndm

And what exactly is the problem? Convert the resulting form to JSON and safely save yourself to a text file.

<?php

$json = json_encode($_POST);
$size = file_put_contents('form.txt', $json);
echo 'Сохранено '.$size.' байт текста';

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question