0

I have searched for a solution to this problem on daniweb and google to no avail. You folks have been so kind as to help me before.

This portfolio piece, slash website for my father incorporates a MySQL PHP search form in the left div, and the search results in the right div.

My intent is to have the .png file appear in the results div upon the first landing of the visitor. To be replaced by the visitors search results. Possibly with a link in case the visitor would like to see it again.

Could someone please point me in the right direction?

ardav?

Attachments enginesale_copy.png 120.49 KB jimsbusscrnsht.jpg 48.74 KB
2
Contributors
3
Replies
6
Views
7 Years
Discussion Span
Last Post by EvolutionFallen
0

Assuming <div id="results"> is the box on the right that first holds the image and then shows results after searching, you could do something like:

// Have code that processes the form, and stores results in an array, or have the form processed further down in the following "if" statement.

<div id="results">
<?php
   if($_POST["submit"]) { // replace "submit" with the name/id of the submit button in your search form
      echo $search_results;
   } else {
      echo '<img src="path/to/image.png" alt="Alternate Text" />';
   }
?>
</div> <!-- /results -->

Hope that helps.

- EF

Edited by EvolutionFallen: n/a

1

Thanks EF!! Other than a few code tweeks worked first time!

Np, glad to help =)

Votes + Comments
No Muss No Fuss! He really new his stuff! Thanks for your help. Motorider
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.