小编Koo*_*bin的帖子

保存domdocument时删除doctype

我正在解析并将html文档提取到DOMDocument.这些文档是将在另一页内显示的子表单.在保存解析的DOMDocuments时,它会自动添加doctype,html,head和body标记.因为我正在处理子表单,我想删除所有这些并仅保存表单的子标签.

如何在保存domdocument的同时跳过自动生成html,head,body和其他标签?

php skip domdocument

15
推荐指数
3
解决办法
7447
查看次数

所有浏览器都支持querySelector吗?

我想知道所有浏览器都支持querySelector吗?它不是什么替代它使用?

我用IE8,FF3,Chrome 4进行了测试.对我来说很好.我没有旧的浏览器.所以我想知道旧浏览器是否会给我带来问题?

javascript cross-browser selectors-api

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

如何避免if ... else和switch case

我一直在编程很多时间.通常我用PHP,ASP.net,Java,JavaScript等语言编程.在所有语言中,我必须使用很多if else语句.就像值= 10然后......如果我查看我的代码然后我发现很多if条件.所以我想尽量减少它们但不确定.

有一点是使用了有些最小化的类但仍然更多......

像任务,猫,秒和类型:

if task = 'add' then
   if cat = "animal" then
      if sec = "man" then
          if type = "male" then
                 'do the following stuffs
          else
                 'do the following stuffs
          end if
      elseif sec = "horse" then
          if type = "run"
                 'do the following stuffs
          else
                 'do the following stuffs
          end if
      elseif....
      end if
   elseif cat = "plant" then
     if sec = "land" then
          if type="tree" then
                 'do the following stuffs
          elseif type = "grass" …
Run Code Online (Sandbox Code Playgroud)

vb.net algorithm programming-languages

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

更改查询字符串中的单个变量值

给我一个页面网址'http://abc.com/test.php?a=1&b=2&c=3'.现在我被告知要将b的值更改为5,以便它变为'http://abc.com/test.php?a=1&b=5&c=3'.

即改变http://abc.com/test.php?a=1&b=2&c=3http://abc.com/test.php?a=1&b=5&c=3

注意:这里的变量b可以引用任何名称.

php regex url-rewriting

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

我们如何从DBA保护我们的数据?

我的数据库中有非常机密的数据.我试图从dba保护我的数据.

我是开发团队的成员.我们在具有自己的dba的服务器中开发我们的软件和delpoy.我们对服务器的控制有限.

在这种情况下,我如何拒绝服务器的dba来查找我的数据并拒绝对它们进行更改.

可能吗?

sql-server security

7
推荐指数
2
解决办法
1178
查看次数

使用正则表达式验证数据是否正确?

我一直在寻找一些文章和帖子,建议不要使用正则表达式来验证用户数据.我不确定所有的事情,但我通常会在电子邮件地址验证的情况下找到它.

所以我想清楚使用正则表达式来验证用户输入是否良好?如果它好,那么验证电子邮件地址有什么不好?

编辑:

所以我们可以说,对于数据类型的基本主要验证,我们可以使用正则表达式并且它是好的,并且对于完全验证,我们需要将它与另一个解析器组合.

对于一般用法中的电子邮件验证的第二部分,我们可以使用它,但根据标准,它是不合适的.是吗?

现在混淆选择正确的答案

regex validation logic

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

CURL请求问题

我正在尝试验证paypal pdt信息.

我生成了我的模型表单并提交了它.IT工作并返回信息.

我尝试了同样的事情来制作卷曲请求.但是我的请求对我来说是空白的.

我的模型形式:

<form method="post" action="https://sandbox.paypal.com/cgi-bin/webscr">
    <input type="hidden" name="cmd" value="_notify-synch"/>
    <input type="hidden" name="at" value="-----"/>
    <input type="hidden" name="tx" value="-----"/>
    <input type="submit" value="Test"/>
</form>
Run Code Online (Sandbox Code Playgroud)

我的CURL REQ代码:

$arrData = array(
    'tx'    => '----',
    'cmd'   => '_notify-synch',
    'at'    => '-----'
);
    $ch = curl_init( 'https://sandbox.paypal.com/cgi-bin/webscr' );
    curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1) ;
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $arrData);
    $strCurlResult = curl_exec($ch);
    curl_close( $ch );
    return $strCurlResult;
Run Code Online (Sandbox Code Playgroud)

编辑:

跟踪卷曲错误我发现以下消息:

SSL:证书主题名称"www.sandbox.paypal.com"与目标主机名"sandbox.paypal.com"不匹配

php curl paypal

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

使用自定义Class对象列表作为crystal report的数据源

我试图找到使用我自己的自定义类设计报表的方法.

我找到了链接:

1.)如何使用对象数据源在Crystal Report中工作?

2.)在Crystal Report 2008中使用.net对象作为数据源

3.)将List <>绑定到Crystal Report

4.)如何在Crystal报表中将Custom类指定为数据源

它们非常有用,但我在设计报表时遇到了第一步,因为我的自定义类的属性没有列在水晶报表设计视图的字段列表中.

我的自定义类的示例:

class UserType
    public property UIN as integer...
    public property Title as string...
end class
class User
    public property UIN as Integer...
    public property Name as string...
    public property Password as String...
    public property Type as UserType...
end class
Run Code Online (Sandbox Code Playgroud)

当我将类对象添加到crystal报表时,我没有从字段列表中的users类获取usertype字段.

那么如何将usertype字段添加到我的字段列表中呢?或者我必须采取另一种方法?

编辑:

我想使用它的原因是:
1.)显示用户可以键入关键字
2 的表单.)程序使用LINQ
3 按照关键字过滤记录.)当用户单击打印按钮时,我想设置过滤记录为我的报告的数据源

vb.net class crystal-reports

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

如何验证paypal的成功支付

我正在尝试获取当客户被重定向到我们网站时传递给我们网站的paypal交易的交易信息.

我在我的沙盒paypal帐户设置中转为自动返回和pdt.我向paypal发布了一个示例事务,它回复了我的返回URL并附加了tx.

正如在一些文档中发现的那样,我对https://www.paypal.com/cgi-bin/webscr进行了卷曲请求,并试图通过传递req值来获取信息,如下所示:

a.) tx = same one received from paypal
b.) at = pdt code given by paypal while turning pdt on
c.) cmd= "_notify-synch"
Run Code Online (Sandbox Code Playgroud)

但结果我得到String(0)"".

我错过了什么?

php paypal payment-gateway paypal-sandbox

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

使用jQuery在当前行之后添加新表行

我正在尝试添加新行,它是当前行的克隆.我试过以下代码.它不会弹出错误但不会添加行.这是我的代码错误吗?还有其他简单的想法吗?

        $('input[name="cmdAddRow"]').live('click', function(){
            $curRow = $(this).parent('tr');
            $newRow = $curRow.clone(true);
            console.log($newRow);
            $curRow.after($newRow);
            console.log('added');
        });
Run Code Online (Sandbox Code Playgroud)

HTML布局:

<table>
    <tr>
        <td><input type="hidden" name="uin" value="xxx"></td>
        <td><input type="text" name="uname" value=""></td>
        <td><input type="text" name="uadd" value=""></td>
        <td><input type="text" name="utel" value=""></td>
        <td><input type="button" name="cmdAddRow" value="Add"></td>
    </tr>
</table>
Run Code Online (Sandbox Code Playgroud)

jquery clone event-handling

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