0

I wanted to write search in wordpress, what I did was created template page for one tab in wordpress site and add following form to it.

<?php  get_header(); ?>

            <div id="primary" class="site-content">
                <div id="content" role="main">

                    <?php while ( have_posts() ) : the_post(); ?>
                        <?php //get_template_part( 'content', 'page' ); ?>
                        <?php// comments_template( '', true ); ?>

                <form name="input" action="" method="get"></br></br>
                    <input type="text" name="test" width="20" />
                    <input type="submit" value="Submit" />

                </form>
                    <?php endwhile; // end of the loop. ?>



                </div><!-- #content -->
            </div><!-- #primary -->

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

Then I tried to catch variable values from post array in other file created in drffernt directory.

There I tried to print the variable.

<?php echo $_POST["test"];?>

Though url shows something like http://localhost/wordpress/skill/test.php?test=bbbbbbb, I get 404 error. Can't I deal with word press as normal php web site? If not what is the best way to achieve this?

4

1 に答える 1