F
F
FIKSER2018-03-24 17:45:48
PHP
FIKSER, 2018-03-24 17:45:48

How to send a message from the php handler not to the mail, but to the hosting folder?

$sendto = "[email protected]";
And how to send just to the hosting where the site is hosted?
That is, to a text file on the hosting

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Y
Yuri, 2018-03-24
@LazyDev

Primitive receiving script:

<?php

$filename = 'messages.txt';
$message = !empty($_REQUEST['message']) ? (string) $_REQUEST['message'] : null;

if ( !is_null($message) ) {
  echo file_put_contents(__DIR__ . "/{$filename}", "{$message}\n", FILE_APPEND)
    ? "saved"
    : "error";
}

A
Anton Shamanov, 2018-03-24
@SilenceOfWinter

The most logical option is via ftp.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question