Jump to content

HIghlighted box


ihatephp

Recommended Posts

<?php

if(isset($_POST['period']) && isset($_POST['interest']) && isset($_POST['loan'])) {
// do calculations

// if loan is good
if() {
// display green text box
}
// if loan is no good 
else {
// display red text box
}


} else {

echo = FORM
<form action="thispage.php" method="post">
Loan Period
<input type="text" name="period" />
Interest Rate
<input type="text" name="interest" />
Loan
<input type="text" name="loan" />
<input type="submit" />
</form>
FORM;

}

?>

 

use that as a starting point

Link to comment
https://forums.phpfreaks.com/topic/130693-highlighted-box/#findComment-678223
Share on other sites

The following will give you an input box with a red border.

 

 

         <?php
    if ($amt<=1000){
echo "<big><b>good loan</b></big>";
<input type="text" name="box" id="box" style="border:1px solid #ff0000;">?>

 

So,if i want this GOOD LOAN to be in a red box,(aft the calcluation) how should i rearrange the codes.

Link to comment
https://forums.phpfreaks.com/topic/130693-highlighted-box/#findComment-678235
Share on other sites

 

  <?php
    if ($amt<=1000){?>
  <big><b>GOOD loan</b></big>
  <input type="text" name="box" id="box" style="border:1px solid #00ff00;">
  <?php
}
else
{
?>
<big><b>BAD loan</b></big>
<input type="text" name="box" id="box" style="border:1px solid #ff0000;">
   <?php
} ?>

 

that will do it

Link to comment
https://forums.phpfreaks.com/topic/130693-highlighted-box/#findComment-678263
Share on other sites

sorry same code just abit neater lol... teasted and works fine!

 

  <?php
    if ($amt<=1000){
  echo '<big><b>GOOD loan</b></big>';
echo ' <input type="text" name="box" id="box" style="border:1px solid #00ff00;">';

}
else
{

echo '<big><b>BAD loan</b></big>';
echo '<input type="text" name="box" id="box" style="border:1px solid #ff0000;">';

} ?>

Link to comment
https://forums.phpfreaks.com/topic/130693-highlighted-box/#findComment-678269
Share on other sites

It worked fine! though the words good loan appears outside the red box.

instead,i'd want to enhance it to be like this.

So, if i have a table with 2 columns , 5 rows,the amount $1000 is good. So the column of $1000 will be lighted red aft the computation.

amount

$100

amount

$1000

 

???

Link to comment
https://forums.phpfreaks.com/topic/130693-highlighted-box/#findComment-678338
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.