1
votes

I would like to hide the bold and italic potion of the script below so that when I click a link tag echo "Advanced Search"; the potion will open and when I click the same link it will close;

<?php
echo "<div class='container'>
  <br>
  <form action='search.php' method='get'>
  <input type='text' name='query' id='keyword' size='45' style='height:21px' value='"
  .htmlentities($query, ENT_QUOTES, 'UTF-8')
  ."' autocomplete='on'>
  <div id='sresults'></div>
  <input type='submit' class='button' style='height:21px' value='"
  .$sph_messages['Search']
    ."'><br><br>";
/** I would like to hide from this point down with the link <a href='#' class=''>Advanced Search</a>" **/
if ($adv==1 || $advanced_search==1) {
echo "<div class='advanced'>
  <div class='left'>";
echo "<input type='radio' name='type' value='and' ";
echo strip_tags($type)=='and'?'checked':'';
echo ">"
  .$sph_messages['andSearch']
  ."<br><br>";
echo "<input type='radio' name='type' value='phrase' ";
echo strip_tags($_REQUEST['type'])=='phrase'?'checked':'';
echo ">"
  .$sph_messages['phraseSearch']
  ."</div>
  <div class='right'>";
echo "<input type='radio' name='type' value='or' ";
echo strip_tags($_REQUEST['type'])=='or'?'checked':'';
echo ">"
  .$sph_messages['orSearch']
  ."<br><br>"
  .$sph_messages['show']
  ."<select name='results'>
  <option ";
you need to do this in JavaScript, not PHP.Barmar
Welcome to Stack Overflow. PHP is a Server Side Scripting language, it is processed before the web server sends it to the browser. So your PHP Code should never appear in your HTML. Your example is not wrapped in the proper PHP Markers, <?php ... ?> Please see: php.net/manual/en/tutorial.firstpage.phpTwisty