Page printing PHP script

Asked

Viewed 17 times

0

The page is printing own lines of php code from the following line:

5189.82){

Entire code:

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<style type="text/css">
    body{padding: 0px; margin: 0px; text-align: center;}
    ul{list-style: none;}
    table{max-width: 260px;}
    table td{width: 120px; height: 20px; text-align: right;}
    #resultados{position: relative;}
    #mobi li{display: inline; font-size: 11pt; margin-right: 15px;}
    #esquerda{float: left; margin-left: 400px; text-align: right;}
    #esquerda ul{margin-top: 0px;}
    #esquerda li{margin-bottom: 12px;}
    #direita{float: right; margin-right: 540px; margin-top: -8px;}
    #lucro{position: absolute; margin-left: 600px; margin-top: 160px; background-color: #FFFF00; width: 200px; height: 70px; border: 1px solid black; padding-top: 10px; padding-bottom: 10px;}
    .grupoUm{background-color: #D3D3D3; border: 2px solid #BEBEBE;}
    .grupoDois{border: 3px solid #2F4F4F;}
</style>
<?php
    $bonus = $_POST['bonus'];
    $email = $_POST['email'];

    $taxaDocSemMobi = 3;

    $taxaDocComMobi = 3.99;

    $inssSemMOBI;
    if($bonus + $taxaDocSemMobi > 5189.82){
        $inssSemMOBI = 570.88;
    }
    else{
        $inssSemMOBI = ($bonus - $taxaDocSemMobi) * 11 / 100;
    }

    $inssComMOBI = 44;

    $receitaTributavelAutonomo = $bonus - $taxaDocSemMobi - $inssSemMOBI;
    $irrfAutonomo;
    $irrfDeducao;
    if($receitaTributavelAutonomo < 1904.98){
        $irrfAutonomo = 0;
        $irrfDeducao = 0;
    }
    else if($receitaTributavelAutonomo > 1903.98 && $receitaTributavelAutonomo < 2827.65){
        $irrfAutonomo = 7.5;
        $irrfDeducao = 142.8;
    }
    else if($receitaTributavelAutonomo > 2826.65 && $receitaTributavelAutonomo < 3752.05){
        $irrfAutonomo = 15;
        $irrfDeducao = 354.8;
    }
    else if($receitaTributavelAutonomo > 3751.05 && $receitaTributavelAutonomo < 4665.68){
        $irrfAutonomo = 22.5;
        $irrfDeducao = 636.13;
    }
    else{
        $irrfAutonomo = 27.5;
        $irrfDeducao = 869.36;
    }
    $irrfSemMOBI = $receitaTributavelAutonomo * $irrfAutonomo / 100 - $irrfDeducao;

    $rendaBruta = $bonus * 12;
    $receitaTributavel = $rendaBruta * (1 - (1 * 32 / 100));
    $porc20Simplificado = $receitaTributavel * 0.8;
    $irrfMEI;
    $irrfMEIDeducao;
    if($porc20Simplificado < 22847.77){
        $irrfMEI = 0;
        $irrfMEIDeducao = 0;
    }
    else if($porc20Simplificado > 22847.76 && $porc20Simplificado < 33919.81){
        $irrfMEI = 7.5;
        $irrfMEIDeducao = 1713.58;
    }
    else if($porc20Simplificado > 33919.80 && $porc20Simplificado < 45012.61){
        $irrfMEI = 15;
        $irrfMEIDeducao = 4257.57;
    }
    else if($porc20Simplificado > 45012.60 && $porc20Simplificado < 55976.17){
        $irrfMEI = 22.5;
        $irrfMEIDeducao = 7633.51;
    }
    else{
        $irrfMEI = 27.5;
        $irrfMEIDeducao = 10432.32;
    }
    $irrfComMOBI = ($porc20Simplificado * $irrfMEI / 100 - $irrfMEIDeducao) / 12;

    $descontaISS = true;
    $issSemMOBI;
    if($descontaISS == true){
        $issSemMOBI = $bonus * 5 / 100;
    }
    else{
        $issSemMOBI = 0;
    }

    $issComMOBI = 5;

    $bonusLiquidoSemMOBI = $bonus - $taxaDocSemMobi - $inssSemMOBI - $irrfSemMOBI - $issSemMOBI;

    $bonusLiquidoComMOBI = $bonus - $taxaDocComMobi - $inssComMOBI - $irrfComMOBI - $issComMOBI;

    $lucro = $bonusLiquidoComMOBI - $bonusLiquidoSemMOBI;
  ?>
</head>
<body>
<div id="resultados">
    <ul id="mobi">
        <li>Sem conta.MOBI</li>
        <li><b>Com conta.MOBI</b></li>
    </ul>
<div id="esquerda"> 
    <ul>
        <li>Taxa DOC/Boleto</li>
        <li>INSS</li>
        <li>IRRF</li>
        <li>ISS</li>
        <li>Bônus Líquido</li>
    </ul>
</div>
<div id="direita">
    <table border="0">
        <tr>
            <td class="grupoUm" id="taxaSemMOBI"><?php echo $taxaDocSemMobi ?></td>
            <td class="grupoDois" id="taxaComMOBI"><?php echo $taxaDocComMobi ?></td>
        </tr>
        <tr>
            <td class="grupoUm" id="inssSemMOBI"><?php echo $inssSemMOBI ?></td>
            <td class="grupoDois" id="inssComMOBI"><?php echo $inssComMOBI ?></td>
        </tr>
        <tr>
            <td class="grupoUm" id="irrfSemMOBI"><?php echo $irrfSemMOBI ?></td>
            <td class="grupoDois" id="irrfComMOBI"><?php echo $irrfComMOBI ?></td>
        </tr>
        <tr>
            <td class="grupoUm" id="issSemMOBI"><?php echo $issSemMOBI ?></td>
            <td class="grupoDois" id="issComMOBI"><?php echo $issComMOBI ?></td>
        </tr>
        <tr>
            <td class="grupoUm" id="bonusLiquidoSemMOBI"><?php echo $bonusLiquidoSemMOBI ?></td>
            <td class="grupoDois" id="bonusLiquidoComMOBI"><?php echo $bonusLiquidoComMOBI ?></td>
        </tr>
    </table>
</div>
<div id = "lucro">
    Você receberá a mais:
    <b><h2 id = "valor"><?php echo $lucro ?></h2></b>
</div>
</div>
</body>
</html>
  • What is the url you access in the browser?

  • file://C:/wamp/www/meixautonomoresultados.php

  • In the address bar when you type file:/// is saying to access the file directly, without going through the PHP interpreter, the right is to use the http://localhost/projeto/index.php or just localhost/projeto/index.php. More details on the link above the question.

  • There’s this other question (very interesting) How the HTTP protocol processes requests? that gives an overview of what happens.

  • Apparent code is right. Probably PHP is not running. To be sure. Go to the page and use the CTRL+U keys and check that the source code received by the browser is equal to the original code. If it is, your problem will be finding out what’s wrong with your server.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.