How i create complex Feed back form

Hello ,
I need help in feedback form. i create 7 fields. Frist name , last name , subject , message . i want if any field is empty he disply the error and go to return back in the current form.
Plz hellp me . Thanks

Comments

  • : Hello ,
    : I need help in feedback form. i create 7 fields. Frist name ,
    : last name , subject , message . i want if any field is empty he
    : disply the error and go to return back in the current form.
    : Plz hellp me . Thanks
    :

    Maybe this will help you out:

    [code]
    $firstname = $_POST['firstname'];
    $lastname = $_POST['lastname'];
    $subject = $_POST['subject'];
    //...and other fields...

    if(empty($firstname) || empty($lastname) || empty($subject){
    $msg_1 = "";
    $msg_2 = "alert('NB! You must fill ALL the fields!');";
    $msg_3 = "";

    echo $msg_1.$msg_2.$msg_3;
    die($msg_1."window.location.href='javascript:history.go(-1)';".$msg_2);
    }
    [/code]
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion