dreamer1231 2016-03-10 20:36
浏览 51

带有3个单选按钮和2个提交按钮的表单,用于重定向到URL

I am creating a simple form in Joomla. I will create an article page with the form and save the script in the template. A user will need to click on a radio button that will redirect to a different URL or page:


O Choice 1
O Choice 2
O Choice 3

[Submit button 1] [Submit button 2]


If user selects Choice 1 and Submits button 1, it will redirect to page1.php
If user selects Choice 2 and 3 and Submits button 1, it will redirect to page2.php
If user selects Choice 1 and Submits button 2, it will redirect to page3.php
If user selects Choice 2 and 3 and Submits button 2, it will redirect to page4.php

I really appreciate some help on this. Thanks.

  • 写回答

1条回答 默认 最新

  • duankun9280 2016-03-10 20:44
    关注

    If you want to redirect directly, you'll need JavaScript to change the link the submit button refers to when the user clicks an option.

    If not, I would recommend that you create a new PHP-File redirect.php, refer to it and then check inside this file which option the user has chosen and redirect him to the asociated page. To redirect with PHP you need to change the header, so you mustn't display any HTML content in the redirect.php file, just the PHP code.

    评论

报告相同问题?

悬赏问题

  • ¥15 我想在一个软件里添加一个优惠弹窗,应该怎么写代码
  • ¥15 fluent的在模拟压强时使用希望得到一些建议
  • ¥15 STM32驱动继电器
  • ¥15 Windows server update services
  • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏
  • ¥15 模糊pid与pid仿真结果几乎一样
  • ¥15 java的GUI的运用
  • ¥15 Web.config连不上数据库
  • ¥15 我想付费需要AKM公司DSP开发资料及相关开发。
  • ¥15 怎么配置广告联盟瀑布流