我想从复选框中做下面的事情,
每行都有一个复选框,我想在单击复选框时禁用类.room的行中的所有输入字段.
function toggleStatus(link) {
$(link).closest(".room").children(':input').attr('disabled', true);
}
Run Code Online (Sandbox Code Playgroud)
也试过了
function toggleStatus(link) {
$(link).closest(".room").children('input[type=text]').attr('disabled', true);
}
Run Code Online (Sandbox Code Playgroud) 我正在尝试编写一组mod_rewrite规则来满足以下条件:
1) /aaa (redirects to) --> /xxx_aaa.php
2) /aaa/ --> /xxx_aaa.php
3) /aaa?w=x&y=z --> /xxx_aaa.php?w=x&y=z
3) /aaa/?y=z --> /xxx_aaa.php?y=z
4) /aaa/bbb/ --> /xxx_aaa_bbb.php
5) /aaa/bbb/ccc/ --> /xxx_aaa_bbb_ccc.php
6) /aaa/bbb/cc12-34cc --> /xxx_aaa_bbb_cc12-34cc.php
7) /aaa/bbb/ccc/?y=z --> /xxx_aaa_bbb_ccc?y=z.php
Run Code Online (Sandbox Code Playgroud)
以上列表并非详尽无遗,但它让您了解我希望涵盖的所有可能的排列.即,这些是:
1)最多三个子目录级别
2)工作是否存在关闭正斜杠
3)传递GET查询字符串,如果存在
这是我现在使用的:
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteRule ^([0-9a-zA-Z\-]+)$ /xxx_$1.php [L]
RewriteRule ^([0-9a-zA-Z\-]+)/$ /xxx_$1.php [L]
RewriteRule ^([0-9a-zA-Z\-]+)/\?([0-9a-zA-Z\-=&]+)$ /xxx_$1.php?$2 [L]
RewriteRule ^([0-9a-zA-Z\-]+)/([0-9a-zA-Z\-]+)$ /xxx_$1_$2.php [L]
RewriteRule ^([0-9a-zA-Z\-]+)/([0-9a-zA-Z\-]+)/$ /xxx_$1_$2.php [L]
RewriteRule ^([0-9a-zA-Z\-]+)/([0-9a-zA-Z\-]+)/\?([0-9a-zA-Z\-=&]+)$ /xxx_$1_$2.php?$3 [L]
RewriteRule ^([0-9a-zA-Z\-]+)/([0-9a-zA-Z\-]+)/([0-9a-zA-Z\-]+)$ /xxx_$1_$2_$3.php [L]
RewriteRule ^([0-9a-zA-Z\-]+)/([0-9a-zA-Z\-]+)/([0-9a-zA-Z\-]+)/$ /xxx_$1_$2_$3.php [L]
RewriteRule ^([0-9a-zA-Z\-]+)/([0-9a-zA-Z\-]+)/([0-9a-zA-Z\-]+)/\?([0-9a-zA-Z\-=&]+)$ …
Run Code Online (Sandbox Code Playgroud) 例如,如果我有example.com/experiments.html且用户输入example.com/experiment.html(否"s"),是否可以使用.htaccess将用户重定向到example.com/experiments.html ?
编辑:"experiments.html"只是一个例子,我有很多页面,用户可能输入错误.有通用的解决方案吗?
我使用的是MongoDB和C#4.0.在MongoDB中,我将CreatedOn存储为DateTime,例如"2011-01-01T01:40:45.041Z".在C#中我使用的是MongoDB驱动程序,那么如何查询特定日期的数据库呢?到目前为止,我已经完成如下...
var fileLogCollection = db.GetCollection<FileLog>();
Document selector = new Document();
selector["CreatedOn"] =dateTimePicker1.Value.Date;
var all = fileLogCollection.Find(selector);
Run Code Online (Sandbox Code Playgroud)
谢谢
我希望以这种方式为我的应用程序使用缓存.
在第一个请求数据来自数据库并将它们传递给控制器查看并将它们存储在缓存中.
在下一个请求中,我希望从缓存中获取数据并将它们放入页面中,并再次从数据库中异步获取数据并检查是否有新的内容然后更新缓存.
因为在最后一个请求数据来自缓存,它会更快并更新缓存以供将来请求使用.
我如何在我的应用程序[MVC 3]中实现这个功能?
我有上传网站,我想知道如何通过PHP知道服务器的空间?
例如:
if($_FILES ...) {
if($server_rest_space enough for the file){
// upload it!
}
else{
echo 'no space on your server enough!'; //there is no space!!
}
Run Code Online (Sandbox Code Playgroud)
重要的另一个问题,如果服务器已满!和一些上传的文件是否会发生错误?
谢谢
我有2个.htaccess文件,我需要合并在一起.一个是由wordpress生成的,另一个是站点的现有.htaccess文件.这2个文件如下:
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.mywebsite\.com$
RewriteRule ^(.*)$ http://www.mywebsite.com/$1 [R=301]
RewriteRule ^postreview/$ /viewreview.php [NC,PT,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ ./template2.php
<IfModule mod_security.c>
# Turn off mod_security filtering.
SecFilterEngine Off
# The below probably isn't needed,
# but better safe than sorry.
SecFilterScanPOST Off
</IfModule>
php_flag session.use_trans_sid off
Run Code Online (Sandbox Code Playgroud)
wordpress生成的第二个文件:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /projectcars/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /projectcars/index.php [L]
</IfModule>
Run Code Online (Sandbox Code Playgroud)
我已经尝试了几种方法来组合它们,但我得到了重定向错误或内部服务器错误.
嗨,我不是任何想象力的程序员,我试图根据以下内容在我的htaccess文件中进行多301重定向:
所以我有大量的网址都有类似的命名约定 - 这里是2的样本.
http://www.hollandsbrook.com/garrett-at-gold/
http://www.hollandsbrook.com/garrett-ace-250/
Run Code Online (Sandbox Code Playgroud)
这些网址需要重定向到:
http://www.hollandsbrook.com/garrett-metal-detectors/garrett-at-gold/
http://www.hollandsbrook.com/garrett-metal-detectors/garrett-ace-250/
Run Code Online (Sandbox Code Playgroud)
我可以一次重定向它们一行,但我想使用正则表达式.
这是我到目前为止所想的但不起作用:
RewriteRule ^ garrett - ([az])/ $/garrett-metal-detectors/$ 1/[R]
基本上我需要重定向任何以"garrett-"开头的根页面,以包含"garrett-metal-detectors"的文件夹路径.
任何想法都会受到很多赞赏.非常感谢您的帮助.
我有以下MySQL:
select `car`.`ID` AS `ID`,
`title`,`text`
from `car`
LEFT JOIN `truck` as bigcar ON bigcar.`ID` = `car`.`truckID`
WHERE `ID` ='1';
Run Code Online (Sandbox Code Playgroud)
出于某种原因,我得到了
where子句中的列'ID'不明确
出于复杂的代码原因,我不会将别名重命名为其他内容(例如ID2)
这不应该起作用吗?
我有以下apache重写规则:
RewriteEngine On
RewriteRule ^id/([^/\.]+)$ item.php?id=$1 [L]
Run Code Online (Sandbox Code Playgroud)
我需要能够与Nginx一起使用它.它的目的是让某人可以访问http://mysite.com/id/10,而不必去http://mysite.com/item.php?id=10.任何人都可以帮我转换吗?
提前致谢!