代码之家  ›  专栏  ›  技术社区  ›  Adam Ramadhan

用输入get发送值?

  •  0
  • Adam Ramadhan  · 技术社区  · 16 年前
    <a href="companies.php?id='. $_GET['id'] .'&offset='. $next_offset .'"><input id="button" type="button" value="More"/>
    

    我想用输入按钮发送&offset=avalue。没有身份证。

        echo '<form action="welcome.php" method="get">';
        echo '<a href="companies.php?id='. $_GET['id'] .'&offset='. $next_offset .'"><input id="button" type="button" value="More"/></a>';      
        echo '</form>';
    

    请评论,如果你们不明白谢谢!

    好吧,不知怎的,我已经设法让它工作了

        echo '<form action="companies.php?id='. $_GET['id'].'" method="get">';
        echo '<input type="hidden" name="offset" value="'.$next_offset.'">';
        echo '<input id="button" type="submit" value="More"/></a>';     
        echo '</form>';
    

    http://local.host/networks/companies.php?offset=5 ,我的身份证去哪了? 顺便说一句,我还在查看,谢谢大家:)

    啊哈!它起作用了

        // MORE PLUGIN
        echo '<form action="companies.php" method="get">';
        echo '<input type="hidden" name="id" value="'.$_GET['id'].'">';
        echo '<input type="hidden" name="offset" value="'.$next_offset.'">';
        echo '<input id="button" type="submit" value="More"/></a>';     
        echo '</form>';
        // END PLUGIN
    
    2 回复  |  直到 13 年前
        1
  •  2
  •   Nikita Rybak    16 年前

    首先,您可以将参数放在窗体的 action 属性,就像您对链接和href所做的那样。

    更可读的选项是隐藏输入元素: <input type="hidden" name="offset" value="your_value">

    这是你问的吗?

        2
  •  2
  •   Byron Whitlock    16 年前

    <? echo '<input type=button onclick=\'window.location="companies.php?offset='. $next_offset .'"\'>';?>

    推荐文章