0

Im just starting out php and i tried making this basic thing, taking value from php code ant pass it into the text box. This is my code:

<body>
  <div>
   <?php
     $myAge= 20;
     $answer;

     if($myAge == 21){
       $answer = "Not true";
      }
     else if ($myAge== 20){
       $answer = "True";
      }
     else $answer = "test";
   ?>
<input type="text" value="<?php echo ($answer); ?>">
  </div>
</body>
Kelb56
  • 581
  • 2
  • 8
  • 20

0 Answers0