小编LHM*_*ies的帖子

发布请求中的换行符

我想发送新行字符作为post请求(文本)变量的值的一部分.我正在使用wget来发出请求.我该如何编码呢?

post newline wget

9
推荐指数
1
解决办法
2万
查看次数

无法匹配mod_rewrite中的%2F

我有一组重写规则(在.htaccess中),如下所示:

RewriteRule ^list/vendor/(.*)$ list.php?vendor=$1
RewriteRule ^list/product/(.*)$ list.php?product=$1
RewriteRule ^list/(.*)$ list.php?search=$1
Run Code Online (Sandbox Code Playgroud)

(我不认为前两个与我的问题有关).

当我输入myserver.com/list/foo%2Cbar或甚至myserver.com/list/foo/bar,我得到我期望的结果:list.php被调用with foo,barfoo/barin $_GET['search'].

但如果我输入myserver.com/list/foo%2Fbar,似乎规则不匹配!我得到了404错误.这可以发生什么?Apache 2.2.14,如果重要的话.

(我在Firefox和Chrome中尝试过相同的结果 - 但当然可能是浏览器正在运行).

mod-rewrite apache2 url-rewriting

7
推荐指数
1
解决办法
4223
查看次数

我如何一次只允许一个选定的按钮?/ make按钮知道我是否点击其他地方

如何制作这些按钮,以便一次只能使用一个?我运行顺便说一句,我现在没有得到任何错误.我只是在寻找解决方案来解决我的挑战.谢谢你的帮助

它们是在for循环中生成的,如下所示:

    for (int l=0; l<list.length; l++) {  

        UIButton *aButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
        [aButton setTag:l];
        CGRect buttonRect = CGRectMake(11+charact*20, -40 + line*50, 18, 21);
        aButton.frame = buttonRect;

        [aButton addTarget:self action:@selector(buttonClicked:) forControlEvents:UIControlEventTouchUpInside];
        [aButton setTitle:@" " forState:UIControlStateNormal];
        [gameScroll addSubview:aButton];
}
Run Code Online (Sandbox Code Playgroud)

然后单击按钮时的操作是:

- (void) buttonClicked:(UIButton *)sender {

    int tag = sender.tag;

    if (sender.selected == TRUE) {
        [sender setSelected:FALSE];
        [sender setBackgroundColor:[UIColor clearColor]];
    }
    else if (sender.selected == FALSE) {
        [sender setSelected:TRUE];
        [sender setBackgroundColor:[UIColor redColor]];
    }
}
Run Code Online (Sandbox Code Playgroud)

现在一切正常但我希望它知道是否已经选择了一个按钮并取消选择其他按钮,或者在用户点击该按钮范围之外的任何时候自动取消选择

提前致谢

iphone select objective-c uibutton

1
推荐指数
1
解决办法
4326
查看次数