最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

Custom form in theme template displaying internal server error upon submission

matteradmin6PV0评论

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.

Post a comment

comment list (0)

  1. No comments so far