I get an error:
Parse error: syntax error, unexpected '.' in precruit.php on line 62
line 62 is
$criteria = . '' . $anesthesia . '<br />'
Main Topics
Browse All TopicsI have the attached function that I use to send email in Joomla. How do I write it so that if a value is not null it will display it...and if the value is empty it will not display it?
For example, I have these lines:
.'' . $anesthesia . '<br />'
.'' . $dermatology . '<br />'
.'' . $earnosethroat . '<br />'
.'' . $familymedicine . '<br />'
.'' . $generalsurgery . '<br />'
.'' . $hospitalist . '<br />'
.'' . $internalmedicine . '<br />'
.'' . $obgyn . '<br />'
.'' . $orthopedics . '<br />'
.'' . $pediatrics . '<br />'
.'' . $other . '<br />'
and I only want them to show up in the email if they have a value.
I thought something like this would work:
if (!is_null($anesthesia)) {
$body .= '' . $anesthesia . '<br />';
}
but when I do that then the rest of the email does not show up when sent.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: mmarthPosted on 2009-11-04 at 19:29:49ID: 25746527
stick this after the post area:
)
========== =====</b><br />' ========== =====</b><br />' ========== =====</b><br />' ========== =====</b><br />'
$criteria = '' ;
if (!empty($anesthesia))
{
$criteria = . '' . $anesthesia . '<br />'
}
if (!empty($dermatology))
{
$criteria = . '' . $dermatology . '<br />'
}
if (!empty($earnosethroat))
{
$criteria = . '' . $earnosethroat . '<br />'
}
if (!empty($familymedicine))
{
$criteria = . '' . $familymedicine . '<br />'
}
if (!empty($generalsurgery))
{
$criteria = . '' . $generalsurgery . '<br />'
}
if (!empty($hospitalist))
{
$criteria = . '' . $hospitalist . '<br />'
}
if (!empty($internalmedicine)
{
$criteria = . '' . $internalmedicine . '<br />'
}
if (!empty($obgyn))
{
$criteria = . '' . $obgyn . '<br />'
}
if (!empty($orthopedics))
{
$criteria = . '' . $orthopedics . '<br />'
}
if (!empty($pediatrics))
{
$criteria = . '' . $pediatrics . '<br />'
}
if (!empty($other))
{
$criteria = . '' . $other . '<br />'
}
then put $criterea :
$body = '<font face=arial><p>'
.'<b>=======================
.'<b>PHYSICIAN INFORMATION</b><br />'
.'<b>=======================
.'<b>First Name:</b> ' . $pfname . '<br />'
.'<b>Last Name:</b> ' . $plname . '<br />'
.'<b>Address:</b> ' . $paddress . '<br />'
.'<b>City:</b> ' . $pcity . '<br />'
.'<b>State:</b> ' . $pstate . '<br />'
.'<b>Zip:</b> ' . $pzip . '<br />'
.'<b>Email:</b> ' . $pemail . '<p>'
.'<b>Best Contact Number:</b> ' . $pphone1 . '<br />'
.'<b>Best Contact Time:</b> ' . $contacttime .' '. $apm .'<br />'
.'<b>Availability:</b> ' . $availabilitydate . '<br />'
.'<b>Board Certified:</b> ' . $bcertified . '<br />'
.'<b>Board Eligible:</b> ' . $beligible . '<br />'
.'<b>=======================
.'<b>SPECIALITIES</b><br />'
.'<b>=======================
. $criteria
.'This is an automated email. Please do not reply to it.</font>';
$mode = 1;