• I’m trying to make a xhtml valid search form using an if/else php statement. I want the searchform to say ‘Search…’ before you type into it, but as soon as you type, it needs to show what you are typing.

    This is the code I have so far:

    value=" <?php
    if
      echo "Search";
    else
      echo "<?php the_search_query(); ?>";
    ?>

    I want the if statement to be something along the lines of if the search query is blank, however I have no idea how to write this in php.

    Any help will be greatly appreciated!

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Making a xhtml valid searchform using a php if/else statement’ is closed to new replies.