Maison  >  Questions et réponses  >  le corps du texte

php怎么两个页面怎么交互传值

我是PHP新手自学的。这是main1.php 我想把TXT文本的值传到main2.php该怎么传?各位看看我写的 mian2.php没有获取到TXT的值?

<html> 
<title>This is my page!!!</title> 
<body> 
<form action="main2.php?name=txtname" meth="post"> 
<input type="text" id="txtname" name="txtname"/><br/> 
<input type ="submit" value='Hit Me'/> 
</form> 
<? 
echo 'this txtvalue is '.'['.$txtname.']'; 
?> 
<br/> 
</body> 
</html>
<?php  
 print "You pass to the value :".$_REQUEST['txtname']  
?>


女神的闺蜜爱上我女神的闺蜜爱上我2799 Il y a quelques jours1579

répondre à tous(1)je répondrai

  • 巴扎黑

    巴扎黑2017-01-24 11:58:22

    <form action="main2.php" meth="post">   
    <input type="text" id="txtname" name="txtname"/><br/>   
    <input type ="submit" value='Hit Me'/>   
    </form>    
    <?php  
     print "You pass to the value :".$_POST['txtname']  
    ?>


    répondre
    0
  • Annulerrépondre