文件操作 - form_contatti.php
返回文件管理
返回主菜单
删除本文件
文件: /home/tecnoht/public_html/studiolegalebelloni--it/wp-content/themes/belloni/form/form_contatti.php
编辑文件内容
<?php if ( ! isset($secure) ){ exit; }else{ if ( $secure != "AUSUUEDHHF64535SGGDGGSFS2WW33" ) { exit; } } function get_variable($name){ if ( isset($_GET[ $name ]) ){ return $_GET[ $name ]; } if ( isset($_POST[ $name ]) ){ return $_POST[ $name ]; } return ""; } $nome = get_variable("nome"); if ( $nome > "" ){ ?> <style> .msg{ line-height: 2!important; border: solid 1px green!important; border-radius: 4px!important; padding: 8px!important; } .redm{ border: solid 1px red!important; } </style> <?php $re = send_mail(); if ( $re == false ){ echo "<p class='msg redm'>Si è verificato un errore in fase di invio email. <br>Ci scusaimo per l'incoveniente.<br><br>Prova più tardi o contatta: <br> <a href='mailto:info@studiolegalebelloni.it'>info@studiolegalebelloni.it</a> <br><br>Grazie </p>"; }else{ echo "<p class='msg' >Email inviata correttamente. Sarai contattato al più presto.</p>"; } }else{ printForm(); } function printForm(){ ?> <style> .row_form > *{ font-size: 18px; } .row_form{ width: 100%; line-height: 1.5; margin-bottom: 14px; } .row_form span{ color: red; } input[type='email'], input[type='text'], #txarea { padding: 8px; width: 100%; /*margin-bottom: 12px;*/ } #ck_privacy{ zoom: 1.4; vertical-align : middle; } #lb_privacy{ vertical-align : middle; } #form_submit{ padding: 10px 18px; background-color: #0D3B61; color: #fff; } .msg{ line-height: 2: border: solid 1px green; border-radius: 4px; } .redm{ border: solid 1px red!important; } </style> <form method="post" action="" onsubmit="return validateForm()"> <div class="row_form"> Nome o Società <span>*</span><br> <input type="text" maxlength="80" id="nome_soc" name="nome" placeholder="Nome o società" autocomplete="name" /> </div> <div class="row_form"> Email <span>*</span><br> <input type="email" id="tx_email" name="email" maxlength="80" placeholder="E-mail" autocomplete="email" autofill="email" /> </div> <div class="row_form"> Messaggio <span>*</span><br> <textarea name="messaggio" id="txarea" ></textarea> </div> <div class="row_form"> Privacy <span>*</span><br> <input type="checkbox" name="privacy" id="ck_privacy" /> <label for="ck_privacy" id="lb_privacy" > Accetto la politica sulla privacy dello Studio Legale Belloni in base alle norme Europee GDPR </label> </div> <div class="row_form"> <input type="submit" id="form_submit" name="submit" value="Invia Modulo" /> </div> <form> <?php } ?> <script> jQuery( document ).ready( function(){ //validate_form() }) function validateForm(){ var validateme = true if ( $("#nome_soc").val() == "" ) { alert("Manca il nome o la società.") return false } if ( $("#tx_email").val() == "" ) { alert("Manca la mail.") return false } if ( $("#txarea").val() == "" ) { alert("Manca il messaggio.") return false } if ( $("#ck_privacy").is(":checked") == false ) { alert("Devi accettare le norme della privacy GDPR.") return false } return true } </script> <?php function send_mail(){ $nome = get_variable("nome"); //$company = get_variable("company"); //$telefono = get_variable("telefono"); $mail = get_variable("mail"); $to = "seo@planetline.it,silvia@studiolegalebelloni,info@studiolegalebelloni"; //,"; //"acquisti@studiolegalebelloni.it,commerciale@studiolegalebelloni.it,seo@planetline.it"; //,acquisti@studiolegalebelloni.it"; $subject = "Richiesta contatto dal sito web studiolegalebelloni.it"; $message = " <style> table td{ padding: 4px; } </style> <div style='font: normal 12pt Arial'> <b>Richiesta contatto</b><br><br> <table border='1' style='font: normal 12pt Arial'> <tr> <td>Nome o Società :</td><td>" . get_variable("nome") ."</td> </tr> <tr> <td>Email :</td><td>" . get_variable("email") ."</td> </tr> <tr> <td>Messaggio </td><td>" . get_variable("messaggio") ."</td> </tr> </table><br><br> Non rispondere alla seguente mail. <br>Viene spedita in automatico. </div> "; $header = "From: STUDIO LEGALE BELLONI <smtp@studiolegalebelloni.it>\r\n"; $header .= "MIME-Version: 1.0\r\n"; $header .= "Content-type: text/html\r\n"; $attachments = ""; $resp = wp_mail( $to, $subject, $message, $header ); return $resp; if ( $resp == true ){ echo " <br><br><br><b>Grazie per averci contattato</b><br><br> La tua richiesta di preventivo è stata spedita regolarmente. <br> Sarai contattato il più presto possibile. <br><br> <a href='/' class='btn_top2' >Ritorna alla Home Page</a> <br><br><br><br>"; }else{ echo " <b>Si è verificato un errore durante l'invio della mail.</b><br><br> Prova a spedire ancora più tardi e se ci sarà ancora errore contattaci a questo indirizzo: <br><br> <a href='mailto:acquisti@studiolegalebelloni.it'>acquisti@studiolegalebelloni.it</a> <br>"; } } ?>
修改文件时间
将文件时间修改为当前时间的前一年
删除文件