0

I want to create custom form page to communicate with database with my own table. I written this code, But its not showing in page attributes template.

My Template Code:

<?php
/*Tempalte Name: ICO Calendar Form */

?>
<?php get_header();?>

<?php
if($POST['submit']){
    global $wpdb;

    $token_id=$_POST['token_id'];
    $coin_name=$_POST['coin_name'];
    if($wpdb->insert('ico_calendar', 
        array(
                'token_id'=>$token_name,
                'coin_name'=>$coin_name
                )
        )== false) wp_die('Database insertion failed');
        else echo 'Database Insertion successful<p />';
        ?>
        <?php

}
else
{
    ?><form action="" method="post" id="ico">



    <label> Token ID:<input type="text" name=
        "token_id" size="30"/></label>
        <label> Coin Name:<input type="text" name=
        "coin_name" size="30"/></label>

  <input type="submit" name="Submit" value="Submit"/>
</form>
<?php
}
?>

closed as off-topic by Michael, Nathan Johnson, Christine Cooper, bosco, Jacob Peattie Mar 2 '18 at 2:45

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

1

The spelling of template is wrong

change

 /*Tempalte Name: ICO Calendar Form */

to

 /*Template Name: ICO Calendar Form */

ref: find detailed info here

Not the answer you're looking for? Browse other questions tagged or ask your own question.