Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Form isn’t sent once we click on submit button

  • This topic is empty.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #32135
    hamanine
    Member

    Would you please help, and see this form isn’t submitted, i am new to wordpress and PHP

      
    /*
    Template Name: template
    */
    ?>

    $nameError="Not yet";
    if (isset($_POST)){
    if (trim($_POST)==='') {
    $nameError="Please enter your name.";
    $hasError=true;
    } else {
    $name=trim($_POST);
    }
    if (!is_email($_POST)) {
    $nameError="Please Enter the right email";
    $hasError=true;
    } else {
    $email=is_email($_POST);
    }
    if (trim($_POST)==='') {
    $nameError="Please enter your nationality";
    $hasError=true;
    } else {
    $nationality=trim($_POST);
    }


    if (trim($_POST)==='') {

    $nameError="Please enter your nationality";
    $hasError=true;

    } else {

    $message=trim($_POST);

    }
    $user_photo=bloginfo('url')."/wp-content/uploads/".basename($_FILES);
    $user_cv=bloginfo('url')."/wp-content/uploads/".basename($_FILES);


    if (move_uploaded_file($_FILES,$user_photo)){
    echo "Photo is uploaded";
    } else {
    echo "photo wasnt uploaded successfully";
    $hasError= true;
    }

    if (move_uploaded_file($_FILES,$user_cv)){
    echo "Cv is uploaded";
    } else {
    echo "CV wasnt uploaded successfully";
    $hasError= true;
    }

    global $wpdb;
    if (!$hasError) {
    $wpdb->query($wpdb->prepare("
    INSERT INTO $wpdb->jobseekers
    (name, email, nationality, photo, cv, message)
    VALUES(%s, %s, %s, %s, %s, %s, %s)",
    $name, $email, $nationality, $user_photo, $user_cv, $message));

    }

    } else {
    $nameError="Not Sent";
    echo "

    Not submitted

    ";


    }

    ?>




































    #53599
    hamanine
    Member

    When I click on submit button no thing happen, it looks the isset($_POST isn’t working

    #53601
    hamanine
    Member

    would you please help? chris?

    #53606

    I believe this line here, “methode” should be “method”:

    #53564
    hamanine
    Member

    thank you I changed that but still have the same problem

    #52911
    ramit
    Member

    try to change to

    #50125
    JoeBass
    Member

    @ramit,

    Did you ever get this to work?

    #49547
    shazdeh
    Member

    change
    if (isset($_POST)){
    to
    if (isset($_POST)){
    also fix the input type=’button’ to input type=’submit’ and ‘methode=”POST”‘ to ‘method’.

Viewing 8 posts - 1 through 8 (of 8 total)
  • The forum ‘Back End’ is closed to new topics and replies.