0

this is test.php file

<html>  
   <body>  
     
      <form action = "gettest.php" method = "GET">  
         Username: <input type = "text" name = "username" /> <br>  
         Blood Group: <input type = "text" name = "bloodgroup" /> <br>  
         <input type = "submit" />  
      </form>  
        
   </body>  
</html>  

this is gettest.php

<html>  
   <body>  
     
      Welcome <?php echo $_GET["username"]; ?> </br>  
      Your blood group is: <?php echo $_GET["bloodgroup"]; ?>  
  
   </body>  
</html>  

gettest.php prints the username and password. But, i want to print the same credentials in another php file as well (consider gettest2.php). I believe that this can be done by giving multiple file paths in the form action section of test.php. However, I dont know how to do this.

  • 2
    No. The action is an URL to send values from the form to the server and get the response. The browser can send only one request and process only one response. To be honest though it's really unclear what you're trying to achieve with what you've suggested anyway, I can't work out what useful practical task you're trying to get the application to do – ADyson Apr 12 '21 at 06:31
  • You have to either send the data twice to two different files or do something like in the link above. If you want to send it twice you can do that using ajax for example. – Ivan86 Apr 12 '21 at 06:59

0 Answers0