The letter comes blank. Js:
registerCoupon() { axios.post('final/php/registerCoupon.php', new FormData(this.$refs.couponForm)) .then((res) => { if ( res != null ) { this.couponPrinter = true; this.tel = ''; this.surname = ''; console.log(res); console.log(this.tel); console.log(this.surname); } else { this.couponPrinter = false; alert('ΠΠΎΠ·Π½ΠΈΠΊΠ»Π° ΠΎΡΠΈΠ±ΠΊΠ°! ΠΠΎΠΏΡΠΎΠ±ΡΠΉΡΠ΅ ΠΏΠΎΠ·ΠΆΠ΅') } }) .catch((err) => { console.error(err) }) } PHP:
<?php $recepient = "ΠΏΠΎΡΡΠ°"; $sitename = "mh36.ru"; $name = $_POST["name"]; $tel = $_POST["tel"]; $date = trim($_POST['none']); $message = "ΠΠΌΡ Π€Π°ΠΌΠΈΠ»ΠΈΡ: $name \nΠΠΎΠΌΠ΅Ρ ΡΠ΅Π»Π΅ΡΠΎΠ½Π°: $tel \nΠΠ°ΡΠ° ΠΊΡΠΏΠΎΠ½Π°: $date"; $pagetitle = "ΠΡΠΎΠ½ΠΈΡΠΎΠ²Π°Π½ΠΈΠ΅ ΠΊΡΠΏΠΎΠ½Π°"; mail($recepient, $pagetitle, $message, "Content-type: text/plain; charset=\"utf-8\"\n From: $recepient"); ?> HTML:
<form @submit.prevent="registerCoupon()" method="post" ref="couponForm"> <input type="text" name="name" pattern='[Π°-ΡΠ-Π―ΡΠ]{4,64} [Π°-ΡΠ-Π―ΡΠ]{4,64}' v-model="surname" placeholder="ΠΠ²Π΅Π΄ΠΈΡΠ΅ Π²Π°ΡΠ΅ ΠΈΠΌΡ ΠΈ ΡΠ°ΠΌΠΈΠ»ΠΈΡ" required :title='titleGen'> <input type="tel" name="tel" v-model="tel" v-mask="'+7 (###) ###-##-##'" placeholder="ΠΠ²Π΅Π΄ΠΈΡΠ΅ Π²Π°Ρ Π½ΠΎΠΌΠ΅Ρ ΡΠ΅Π»Π΅ΡΠΎΠ½Π°" required title="ΠΡΠΏΠΎΠ»ΡΠ·ΡΠΉΡΠ΅ ΡΠΎΠ»ΡΠΊΠΎ ΡΠΈΡΡΡ"> <button type="submit">ΠΡΠΏΡΠ°Π²ΠΈΡΡ</button> <transition name="fade"> <div class="p-coupon__activate" v-if="couponPrinter"> <p>ΠΡΠΏΠΎΠ½ Π°ΠΊΡΠΈΠ²ΠΈΡΠΎΠ²Π°Π½! ΠΠ°ΠΌ ΠΎΡΡΠ°Π»ΠΎΡΡ Π΅Π³ΠΎ ΡΠ°ΡΠΏΠ΅ΡΠ°ΡΠ°ΡΡ ΠΈ ΠΏΡΠ΅Π΄ΡΡΠ²ΠΈΡΡ Π°Π΄ΠΌΠΈΠ½ΠΈΡΡΡΠ°ΡΠΎΡΡ. Π ΠΎΠ΄ΠΈΠ½ Π΄Π΅Π½Ρ Π²Ρ ΠΌΠΎΠΆΠ΅ΡΠ΅ Π°ΠΊΡΠΈΠ²ΠΈΡΠΎΠ²Π°ΡΡ ΡΠΎΠ»ΡΠΊΠΎ ΠΎΠ΄ΠΈΠ½ ΠΊΡΠΏΠΎΠ½!</p> <button @click="printCoupon(index)">Π Π°ΡΠΏΠ΅ΡΠ°ΡΠ°ΡΡ</button> </div> </transition> </form>
Notice: Undefined variable: nameCoupon. So with two variables. - KEZOV