简体   繁体   中英

PHP post submit not submitting

I have a button that is not submitting a form via php post request. I don't understand why it's not producing the result when the button is pressed.

<?php  

    if ($_POST["submit"]){
        //$result="form submitted";
        $result='<div class="alert alert-success">form submitted</div>';
    }

?>

which is referenced from here within a html body:

<input type="submit" name="submit" class="btn btn-success btn-lg" value="Submit" />

here's the problem on a live site. the website

Is it possible that you just forgot to echo the result, like this:

 if ( isset( $_POST["submit"] )){
    //$result="form submitted";
    $result='<div class="alert alert-success">form submitted</div>';
    echo $result;
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM