Do multiple `<? php? >` tags represent different domains?

do multiple tags represent different domains?

<form method="get">
    <input type="text" name="num1" placeholder="num1">
    <input type="text" name="num2" placeholder="num2">
    <button type="submit" name="submit" value="func1"></button>
</form>


<?php

global $result;
$result = 0;


if(isset($_GET["submit"]) && $_GET["submit"] == "func1"){
    $num1 = $_GET["num1"] || 0;
    $num2 = $_GET["num2"] || 0;

    $result = $num1 + $num2;

}

?>

The result is: <?php
    echo $result;
?>

in my case, I can"t use the $result defined in the first tag within the second tag.

Php
Apr.09,2021

the same page should be in the same scope
according to your code, your QueryPrams should be ? submit=func1&num1=1&num2=3 . Check to see if there is something wrong with your access method

. < hr >

add the relevant test results

   

Menu