douxing2652 2015-03-14 15:21
浏览 46

下拉框更改标题位置PHP

I am working on a PHP script that will change the header of the page the user is currently on when a dropdown selection is made, the page will stay the same, but the information will alter. I am able to do this by manually changing the location in the URL bar, but so far have been unable to change the header automatically.

<select name = "rowno" onchange=header("Location: /Work/Log/new.php?rowno=$rowno")>

I am totally unsure of how to do this, so any help would be greatly appreciated, I have already set $rowno as a variable.

EDIT

$header = $entry[ID];
$iCountHeader = count($header);
echo '<select onchange="this.options[this.selectedIndex].value && (window.location = this.options[this.selectedIndex].value);">';
for ($i = 0; $i < $iCountHeader; ++$i )
{
echo '<option value ="/Work/Log/New.php?rowno=' . $header[$i] . '">' . $header [$i] . '<option>';
}

This has allowed me to go to 'http://localhost:8800/Work/Log/1' for example, but I am still unable to make it go to 'http://localhost:8800/Work/Log/new.php?rowno=1'

  • 写回答

1条回答 默认 最新

  • dongshao2967 2015-03-14 15:31
    关注
    $aHeaders = array( '1', '2', '3' );
    $iCountHeaders = count( $aHeaders );
    echo '<select onchange="this.options[this.selectedIndex].value && (window.location = this.options[this.selectedIndex].value);">';
    for( $i = 0; $i < $iCountHeaders; ++$i )
    {
        echo '<option value="/Work/Log/new.php?rowno=' . $aHeaders[ $i ] . '">' . $aHeaders[ $i ] . '</option>';
    }
    echo '</select>';
    
    评论

报告相同问题?

悬赏问题

  • ¥15 微信会员卡接入微信支付商户号收款
  • ¥15 如何获取烟草零售终端数据
  • ¥15 数学建模招标中位数问题
  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向
  • ¥15 如何用python向钉钉机器人发送可以放大的图片?