Answer the question
In order to leave comments, you need to log in
How to put a variable in a filename?
The script takes the data from the form and creates a text file in which to write the data with the delimiter ";"
Question: How to force this script to put in the name of this file the phone number that the person entered in the form?
<?php
echo 'Форма успешно отпарвлена!';
$user_name = $_POST['user_name'];
$user_phone = $_POST['user_phone'];
$user_address = $_POST['user_address'];
file_put_contents('/home/misha/html/**********.txt' .$user_name.';'.$user_phone.';'.$user_address. PHP_EOL, FILE_APPEND);
?>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question