最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Custom form in theme template displaying internal server error upon submission

programmeradmin6浏览0评论

I have a custom form in WordPress theme template but it is displaying internal server error upon submission. There is no error in error.log file regarding this submission. I am hosting my website on bluehost and here is my form

<form method="post"  action="<?php echo get_template_directory_uri(); ?>/formprocessing.php">    
        <label for="first-name">Name*</label>
        <input class="form-control" type="text" id="name" name="volunteerName" required/>
        <label for="address">Address*</label>
        <input class="form-control" type="text" id="address" name="volunteerAddress" required/>
        <label for="email">Email*</label>
        <input class="form-control" type="email" id="email" name="volunteerEmail" required/>
        <input class="form-control" class="btn btn-primary" type="submit" value="Submit" id=""/>
</form>

In formprocessing.php file I am just displaying some text and upon submission it redirects to this template file but displaying Internal server error.

<?php   
if (isset($_POST['volunteerName'])){

echo "Form working";
exit;

}
?>

I have spent a lot of time to figure out this issue but still not able to figure out this. Your help will be much appreciated.

发布评论

评论列表(0)

  1. 暂无评论