douyan4470 2019-03-15 17:48
浏览 104
已采纳

添加指向自定义表单的链接

Basically what i wanted to achieve here is adding a "?" to the form url.

My current code that is not working:

<form action="'.$config['base_url'].'/whatever/users.php?f=verification">
    <button class="btn btn-success">Verification</button>
</form>

i would love for someone to explain what i did wrong so i can learn from my mistake and also possibly solve the issue to retain a good answer along with me learning to see what i did wrong here.

As far as my testing goes everything else seams to be working, what is happening here is that i get redirected to "/whatever/users.php" instead of "/whatever/users.php?f=verification"

  • 写回答

1条回答 默认 最新

  • doufei2194 2019-03-15 17:52
    关注

    echo the base_url into the form action and add the f parameter and value to the button element. On submit f=verification will be in the POST/GET.

    <form action="<?=$config['base_url']?>/whatever/users.php">
         <button class="btn btn-success" type="submit" name="f" value="verification" >Verification</button>
    </form>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?