0
 <?php
   $a="";
   $b="";
   $c="";
   if(isset($_GET["plus"]))
   {
       $a=$_GET['eknum'];
       $b=$_GET['donum'];
       $c=$a+$b;
   }
   ?>
       <form action="index.php" method="GET">
            <input type="text"  name="eknum" value="
                   <?php
                    echo "$a";  ?> " />
            <br> 
            <input type="text"  name="donum" value="
                   <?php echo $b;  ?>
                   " />
            <br> 
            <input type="text"  name="execute" 
                   value="
                   <?php echo $c;        ?>
                   " />

             <input type="submit" value="sum" name="plus">

            </form>

Edited by kuldeepsheoran

3
Contributors
2
Replies
11
Views
3 Years
Discussion Span
Last Post by pritaeas
0

if the text in your input elemnets is being aligned in the center, that means you have some style that is being applied either to the input elements either directly or being inherited somehow.

Just apply the { text-align: left } property to your input elements. For example..

form input { text-align: left }
1
<input type="text"  name="donum" value="
               <?php echo $b;  ?>
               " />

The above adds unnecessary spaces to your input. Try:

<input type="text" name="donum" value="<?php echo $b; ?>" />
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.