Answer the question
In order to leave comments, you need to log in
PHP script for creating a file in the root of the site (with data) how to implement?
Good day, please help to implement a script that will create a file (with field data) in the root of the site after filling out the form.
for example html code:
<form action="/send.php" method="post">
<div><input autocomplete="off" type="text" name="POLE-1" placeholder="x"></div>
<div><input autocomplete="off" type="text" name="POLE-2" placeholder="x"></div>
<div><input autocomplete="off" type="text" name="POLE-3" placeholder="x"></div>
<div><textarea autocomplete="off" type="text" name="POLE-4" placeholder="x"></textarea></div>
<button type="submit" name="form_submit">Send</button>
</form>
Answer the question
In order to leave comments, you need to log in
<?php
// Где $value - содержимое файла
file_put_contents($_SERVER["DOCUMENT_ROOT"]."/".date("d-m-Y").".ani", $value);
?>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question