Recent Posts
C# | 6 sec ago
None | 34 sec ago
None | 39 sec ago
PHP | 46 sec ago
C# | 52 sec ago
None | 59 sec ago
None | 1 min ago
None | 1 min ago
None | 1 min ago
C++ | 1 min ago
Sitereport
Find cool info about any domain on the internet?
visit sitereport
Free Subdomains
Want a pastebin.com sub-domain for your community?
learn more...
What is pastebin?
Pastebin is a website that hosts all your text & code on dedicated servers for easy sharing.
learn more...
Learn a little bit about the new Pastebin.com on our help page. hide message
By VAB_Formas on the 9th of Feb 2010 06:40:29 PM Download | Raw | Embed | Report
  1. <?php
  2.       //resgata o valor dos posts
  3.       $opcao = $_POST['opcao'];
  4.       $total = $_POST['total'];
  5.      
  6.       //faz o teste para verifica a comparação
  7.       switch($opcao){
  8.          /**
  9.           *se for igual a opção entrada
  10.           * no exemplo eu dividir o valor 3 , dizendo que são 3 parcelas
  11.           * sem juros, e para saber o valor de entrada
  12.           * Depois monta o $msg
  13.           */
  14.          
  15.          case 'entrada' :
  16.           $entrada = $total / 3;
  17.           $msg  = '<input type="radio" name="forma" value="'.$entrada.'" />';
  18.           $msg .= 'Entrada de :'.$entrada;
  19.          break;
  20.      
  21.          case 'vista' :
  22.          $msg = '<input type="radio" name="forma" value="'.$total.'" />
  23.                   Preço a Vista :'.$total;
  24.          break;
  25.       }
  26.       //no final ele imprime essa mensagem
  27.       echo $msg;
  28.  
  29. ?>
Submit a correction or amendment below. [ previous version ] | [ difference ] | Make A New Post
To highlight particular lines, prefix each line with @h@
Syntax highlighting:
Post expiration:
Post exposure:
Name / Title:
Email: