Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

239
Visualizações
Struggling to increment table column in fives up to a certain number

So basically if $minimum was 30 and $maximum was 40. I wanted the left hand column to from 30 then 35 then 40 while multiplying the values together. I would love some help or even advice. I added a picture with the result after clicking submit in the html form.

<?php

if ($_SERVER["REQUEST_METHOD"] == "GET") {
    $costOne = trim($_GET["c1"]);
    $costTwo = trim($_GET["c2"]);
    $costThree = trim($_GET["c3"]);
    $costFour = trim($_GET["c4"]);
    $costFive = trim($_GET["c5"]);
    $minimum = trim($_GET["min"]);
    $maximum = trim($_GET["max"]);
}

echo '<table>';
echo '<tr>';
echo '<th>Cost per person<br>Party size</th>';
echo "<th>$costOne</th>";
echo "<th>$costTwo</th>";
echo "<th>$costThree</th>";
echo "<th>$costFour</th>";
echo "<th>$costFive</th>";
echo '</tr>';

for ($col=$minimum; $col <= $maximum; $col+5) {
    echo "<tr>";
    echo "<td>$col</td>";
    echo "<td>$col*$costOne</td>";
    echo "<td>$col*$costTwo</td>";
    echo "<td>$col*$costThree</td>";
    echo "<td>$col*$costFour</td>";
    echo "<td>$col*$costFive</td>";
    echo "</tr>";
}
echo '</table>';
?>

Result: Catering costs

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda