Jump to content

Trying to make a math thing with variabels


bylletski

Recommended Posts

Hello i want to $one + $two and then get the answer but i have stuck right now.

 

<?php

$one = $_POST['one'];
$two = $_POST['two'];

if(isset($_POST['button'])) {

    if ($one + $two) {
    
    echo ;
    
    }

}


?>

<form method="post" action="new.php">
<input type="text" name="one">+
<input type="text" name="two">
<input type="submit" name="button">
</form>

Never mind i figure it out.

 

<?php

$one = $_POST['one'];
$two = $_POST['two'];

if(isset($_POST['button'])) {
    
    echo $one + $two;

}


?>

<form method="post" action="new.php">
<input type="text" name="one">+
<input type="text" name="two">
<input type="submit" name="button">
</form>

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.