• Resolved yasasa

    (@yasasa)


    I have a simple form which will be later developed into searching a database, but I cannot figure out why this form doesn’t work in Neve. I put the following under a copy of single.php in Neve folder.

    <?php
    if(isset($_POST[‘submitsearch’])){
    $searchkey = $_POST[‘searchwork’];
    echo $searchkey;
    }
    ?>
    <body>

    <form action=”search_works.php” method=”POST”>
    <input type=”text” name=”searchwork” placeholder=”Search for pieces”>
    <input type=”submit” name=”submitsearch” value=”Find”>
    </form>

    Above search_works.php is the template I made to insert this code and use on the “/search” page, which is visible to the user (atm, the web page is not public).

    Instead of echoing the search term the user submits, it redirects to the default search and searches for “search_works.php” which is the form action. I’d be thankful if anyone could give me an idea of what might be going on here.

    • This topic was modified 1 year, 7 months ago by yasasa.
    • This topic was modified 1 year, 7 months ago by yasasa.

    The page I need help with: [log in to see the link]

  • The topic ‘Search form issue’ is closed to new replies.