Jump to content

variable not being notice


divinedesigns1

Recommended Posts

hey, im having a problem with making a form into a sticky form, the script works perfectly fine but when i try to make the form into a sticky form its saying the variable is undefine, the form is outside of the script but that shouldnt matter so this is the script im using

if(isset($_POST['submit_contact'])){   // define the variables   $fullname = mysqli_real_escape_string($con, $_POST['fn']);   $company = mysqli_real_escape_string($con, $_POST['cn']);   $email = $_POST['email'];   $sub = mysqli_real_escape_string($con, $_POST['sub']);   $opinion = $_POST['coc'];   // filter the variable   $fullname = strip_tags($fullname);   $fullname = stripslashes($fullname);   $company = strip_tags($company);   $company = stripslashes($company);   $email = strip_tags($email);   $email = stripslashes($email);   $opinion = strip_tags($opinion);   $opinion = stripslashes($opinion);   // define the errors   $errors = array();   // check if the variables are empty   if(empty($fullname) && empty($company) && empty($email) && empty($opinion) && empty($sub)){    echo 'all fields are requested';   }elseif(empty($fullname)){    echo 'Please Enter Your Name';   }elseif(empty($company)){    $cn = 'No Company';   }elseif(empty($email)){    echo 'Please Enter A Valid Email';   }elseif(empty($opinion)){    echo 'Text Is Required';   }elseif(empty($sub)){    echo 'Subject Is Requested';   }elseif(!empty($fullname) && !empty($company) && !empty($email) && !empty($opinion) && !empty($sub)){    // define the receiver    $to = "dds1@dds1.net";    $subject = $sub;    $message = $opinion;    $from = $fullname;    $headers = "From:" . $fullname;    mail($to, $subject, $message, $headers);    echo 'We will response to you as soon as possible';   }  }

as you can see i define the variables making sure everything is in place "ignore the mysqli_real_escape_strings at the top, im just messing around to see what will happen" but this sticky form should be working right?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...