Add Server Side validation in Ajax mail form

Solved! Just add the vaidation in PHP and simply ECHO error messages: function smail(){ $nome = $_REQUEST[‘nome’]; $cognome = $_REQUEST[‘cognome’]; $email = $_REQUEST[’email’]; $telefono = $_REQUEST[‘telefono’]; $numero = $_REQUEST[‘numero’]; $messaggio= $_REQUEST[‘messaggio’]; $prod_mail = $_REQUEST[‘prod_mail’]; $prodotto = $_REQUEST[‘prodotto’]; $confezione = $_REQUEST[‘confezione’]; $prezzo = $_REQUEST[‘prezzo’]; if($nome === ”) { $nome = “<span style=”color:#8c8c8c;”>Nome non inserito</span>”; }; if($cognome … Read more

How to let a user create a post by submitting a POST form?

The echo part should be at the end of your code. Keep that in mind, any echo or print should be at the end of your piece of code. <?php if( $_POST[‘title_given’] ) { // Create post object $my_post = array( ‘post_title’ => wp_strip_all_tags( $_POST[‘title_given’] ), ‘post_content’ => ‘Did it work??’, ‘post_status’ => ‘publish’, ‘post_author’ … Read more

HTML Form Question

So all you want to do is have a person type information in a few fields, then you display all that information in a sentence structure? You don’t need PHP for that. JavaScript will do the job. The following page will set up a JavaScript form on your page and how to get the information … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)