in reply to if statement question
Tip #2 from the Basic debugging checklist: display the contents of variables using print:
print ">>>$search<<<"; if ($search) { } [download]