Jump to content


Photo

multiple conditions


  • Please log in to reply
1 reply to this topic

#1 sylunt1

sylunt1
  • Members
  • PipPip
  • Member
  • 22 posts

Posted 14 July 2006 - 10:54 PM

Greetings:

I have a hopefully simple question.

What I want to do is this...  If a date is 9999-12-12 then print a "-" - this part I have and it works fine.  But what I want to do is add a 2nd condition - if upgrade = 0 then use a different font.  I am not sure how to add another condition without printing the whole line again.

Any help would be appreciated.


if ($exp_date == "December 31, 9999"){
print '<table border="0" width="80%" cellspacing="0" cellpadding="0">';
	echo '<tr><td width="40%">' . $sw_name . '</td><td width="20%"><a href="file:///\\endps\License Confirmations/' . $lic_num . '.rtf" target="_blank">' . $lic_num . '</a></td><td width="20%">' . $po_num . '</td><td width="20%">-</td></tr></table>';
}

else{
print '<table border="0" width="80%" cellspacing="0" cellpadding="0">';
	echo '<tr><td width="40%">' . $sw_name . '</td><td width="20%"><a href="file:///\\endps\License Confirmations/' . $lic_num . '.rtf" target="_blank">' . $lic_num . '</a></td><td width="20%">' . $po_num . '</td><td width="20%">' . $exp_date . '</td></tr></table>';
 
}


#2 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 14 July 2006 - 11:33 PM

$echo_table1='<table border="0" width="80%" cellspacing="0" cellpadding="0">';
echo '<tr><td width="40%">' . $sw_name . '</td><td width="20%"><a href="file:///\\endps\License Confirmations/' . $lic_num . '.rtf" target="_blank">' . $lic_num . '</a></td><td width="20%">' . $po_num . '</td><td width="20%">-</td></tr></table>';



$echo_table2='<table border="0" width="80%" cellspacing="0" cellpadding="0">';
echo '<tr><td width="40%">' . $sw_name . '</td><td width="20%"><a href="file:///\\endps\License Confirmations/' . $lic_num . '.rtf" target="_blank">' . $lic_num . '</a></td><td width="20%">' . $po_num . '</td><td width="20%">' . $exp_date . '</td></tr></table>';



if ($exp_date == "December 31, 9999") {

echo $table1;

}else{

echo $table2;

}elseif($upgrade=="0"){

str_replace(" '\ .\ $lic_num \.\ '\.\rtf\", "what_ever.rtf", $table1);
echo $table1;

}else{

str_replace(" '\.\ $lic_num\ .\ '\.\rtf\", "what_ever.rtf", $table2);
echo $table2;
}

good starting point anyway.
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users