if logic inside php

<h1>Recurring payment info:</h1>
<p> '.$recurring_info.' </p>

I need this:

if $recurring_info=!"" :
<h1>Recurring payment info:</h1>
<p> '.$recurring_info.' </p>
<?php
$body_admon ='

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>

</head>

<body>


<h1>Admin Order Confirmation</h1>

<p>Order Date: '.$order_date.' </p>
<h1>Credit Card Info:</h1>
<p>
<b>Credit Card number:</b> '.$hidden_card .'
<br>
<b>'.$ptype.':</b> <i>$'.$amount.'</i><br>

<h1>Recurring payment info:</h1>
<p> '.$recurring_info.' </p>


<h1>Tribute info:</h1>
<p> '.$tribute_info.' </p>

<h1>Donor info:</h1>
<p> '.$donor_info.' </p>
<h1>Please direct my gift to:</h1>
<p> '.$donation_to.' </p>
<h1>Additional information:</h1>
<p> '.$other_to.' </p>
</body>
</html>

';?>

Open in new window

phillystyle123Asked:
Who is Participating?
 
Dave BaldwinFixer of ProblemsCommented:
I think this will work.
<?php
$body_admon ='

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>

</head>

<body>


<h1>Admin Order Confirmation</h1>

<p>Order Date: '.$order_date.' </p>
<h1>Credit Card Info:</h1>
<p>
<b>Credit Card number:</b> '.$hidden_card .'
<br>
<b>'.$ptype.':</b> <i>$'.$amount.'</i><br>';

if ($recurring_info!="") {
$body_admon .='<h1>Recurring payment info:</h1>
<p> '.$recurring_info.' </p>';
}

$body_admon .='
<h1>Tribute info:</h1>
<p> '.$tribute_info.' </p>

<h1>Donor info:</h1>
<p> '.$donor_info.' </p>
<h1>Please direct my gift to:</h1>
<p> '.$donation_to.' </p>
<h1>Additional information:</h1>
<p> '.$other_to.' </p>
</body>
</html>

';?>

Open in new window

0
 
phillystyle123Author Commented:
thanks-much appreciated
0
 
Dave BaldwinFixer of ProblemsCommented:
You're welcome, thanks for the points.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.