Grow your CSS skills. Land your dream job.

my wordpress doesn’t recongnize in form processor file

  • # March 27, 2011 at 6:01 pm

    Hi a wordpress form that I send to itself, but it doesn’t recongnize is_email, get_header, bloginfo functions when I click on submit?

    < ?php
    /*
    Template Name: template
    */
    ?>
    < ?php
    $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 12″;
    echo “

    Not submitted

    “;

    }

    ?>
    < ?php get_header();?>

    ” method=”post”>

    • < ?php if($nameError != '') { ?>
      < ?php echo $nameError; ?>
      < ?php } ?>

    < ?php get_sidebars(); ?>
    < ?php get_footer(); ?>

    # April 8, 2011 at 9:53 am

    Not sure I know the answer but as a quick and dirty hack why not include the bits you need in hidden form fields?

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".