走过海棠暮

文章 0 评论 0 浏览 24

走过海棠暮 2024-11-05 17:44:00

您在整个表单中嵌套了额外的表单标签。您只需要一个表单标签。所有输入都在其中。

<form name="addaserver" method="post" action="addaserver.php">
    <p>Server Name</p>
    <input name="servername" type="text" />

    <p>Description<</p>
    <input name="description" type="text" />

    <p>Server IP</p>
    <input name="ip" type="text" />

    <p>Tags (ex: "pvp, economy, fun")</p>
    <input name="tags" type="text" />

    <input name="submitserver" type="submit" value="submit" />
</form>

You're nesting extra form tags throughout your form. You only need one form tag. All of the inputs go inside it.

<form name="addaserver" method="post" action="addaserver.php">
    <p>Server Name</p>
    <input name="servername" type="text" />

    <p>Description<</p>
    <input name="description" type="text" />

    <p>Server IP</p>
    <input name="ip" type="text" />

    <p>Tags (ex: "pvp, economy, fun")</p>
    <input name="tags" type="text" />

    <input name="submitserver" type="submit" value="submit" />
</form>

PHP/HTML 表单提交

走过海棠暮 2024-11-05 17:16:57

好的,我找到了一种将其与 Drupal 中的 CCK 集成的方法
http://batayneh.me/post/how-pull -tweet-pasting-its-url-drupal-cck

Ok, i figured a way out to integrate this with CCK in Drupal
http://batayneh.me/post/how-pull-tweet-pasting-its-url-drupal-cck

根据提供的推文 URL 拉取推文

走过海棠暮 2024-11-05 02:00:59

我的条件是如果如果
输入空白按钮
字段,那些空白数据不应该
录入数据库

你的意思是,当没有输入任何字段时,你不输入?

我应该如何避免这种情况?

这就是所谓的编程。基本上不是一个 SQL 问题。您的表格应该检查是否应该插入内容。如果不是,它甚至不应该接触 sql server。

Am having the condition that if if
enter the button with blank
fields,those blank datas should not
entered into the database

You mean, when no fiels are entered, you dont enter?

how should i avoid that?

It is called programming. Basiaclly not a SQL issue to start with. Your form should check whether or not it should make an insert or not. If not it should not even touch sql server.

MS SQL Server 中的数据限制

走过海棠暮 2024-11-05 01:05:19

一个非常晚的答案...

如果您设置自己的服务器,您可以使用它来帮助您的桌面应用程序获得 Twitter 上用户的授权,而无需共享(即:嵌入)您的密钥。

您可以使用这种方法:

当用户安装您的桌面应用程序时,她必须在 twitter 和您的服务器上注册它
*)
*) 应用程序要求服务器生成令牌请求 URL
*) 服务器将生成的URL发送给应用程序
*) 应用程序将用户引导至授权 URL
*) 用户在 Twitter 上授权您的应用程序并将生成的 PIN 粘贴到其中
*) 使用 PIN,您的应用程序可以获取令牌
*) 所有进一步的通信都使用令牌,并且不涉及您的服务器

注意:应用程序使用服务器的用户凭据(例如:id 和密码)登录到您的服务器。

A really late answer...

If you setup your own server, you can use it for helping you desktop app getting authorized by users on twitter without sharing (i.e.: embedding) your secret key.

You can use this approach:

When a user installs you desktop app she must register it with twitter and with your server
*)
*) The app asks the server to generate the token request URL
*) The server sends the generated URL to the app
*) The app directs the user to the authorize URL
*) The user authorizes your app on twitter and pastes the generated PIN into it
*) Using the PIN you app grabs the token
*) All further communication uses the token and does not involve your server

Note: the app logs to your server using the user credentials (e.g.: id and password) for your server.

如何在应用程序的二进制文件中存储秘密 API 密钥?

走过海棠暮 2024-11-04 08:06:17

我已经切换到 iframe

<iframe frameborder="0" scrolling="no" src="http://platform.twitter.com/widgets/tweet_button.html?counturl=http://www.mywebsite.com&count=vertical&via=mytwitter&text=My%20Text&url=http://www.mywebsite.com&"
                        style="width:55px; height:65px; overflow:hidden; position:relative;" />

通过这样做,重新渲染不会影响按钮。

I've switched to iframe

<iframe frameborder="0" scrolling="no" src="http://platform.twitter.com/widgets/tweet_button.html?counturl=http://www.mywebsite.com&count=vertical&via=mytwitter&text=My%20Text&url=http://www.mywebsite.com&"
                        style="width:55px; height:65px; overflow:hidden; position:relative;" />

By doing this, reRender will not affect the button.

在 JSF 上重新渲染推文按钮

走过海棠暮 2024-11-04 06:49:46

在设置参数后,您可以使用 adapter.InsertCommand.ExecuteNonQuery() 来提交数据库中的插入操作。

例如:

DataTable dtUsers = new DataTable("tblUsers");
BindingSource bsUsers = new BindingSource();
SqlDataAdapter daUsers = new SqlDataAdapter("usp_GetUsers",Properties.Resources.ConnectionString);
daUsers.InsertCommand = new SqlCommand("usp_InsertNewUser");
daUsers.InsertCommand.Connection = new SqlConnection(Properties.Resources.ConnectionString);
daUsers.InsertCommand.CommandType = CommandType.StoredProcedure;
daUsers.InsertCommand.Parameters.Clear();
daUsers.InsertCommand.Parameters.Add("@username", SqlDbType.VarChar, 50).Value = txtUser.Text;
daUsers.InsertCommand.Parameters.Add("@password", SqlDbType.VarChar, 50).Value = txtPass.Text;
daUsers.InsertCommand.Parameters.Add("@userType", SqlDbType.Int).Value = cbxUserType.SelectedValue;
daUsers.InsertCommand.ExecuteNonQuery();
daUsers.Update(dtUsers);

You may use adapter.InsertCommand.ExecuteNonQuery() after setting the params to commit inserting in database.

For example:

DataTable dtUsers = new DataTable("tblUsers");
BindingSource bsUsers = new BindingSource();
SqlDataAdapter daUsers = new SqlDataAdapter("usp_GetUsers",Properties.Resources.ConnectionString);
daUsers.InsertCommand = new SqlCommand("usp_InsertNewUser");
daUsers.InsertCommand.Connection = new SqlConnection(Properties.Resources.ConnectionString);
daUsers.InsertCommand.CommandType = CommandType.StoredProcedure;
daUsers.InsertCommand.Parameters.Clear();
daUsers.InsertCommand.Parameters.Add("@username", SqlDbType.VarChar, 50).Value = txtUser.Text;
daUsers.InsertCommand.Parameters.Add("@password", SqlDbType.VarChar, 50).Value = txtPass.Text;
daUsers.InsertCommand.Parameters.Add("@userType", SqlDbType.Int).Value = cbxUserType.SelectedValue;
daUsers.InsertCommand.ExecuteNonQuery();
daUsers.Update(dtUsers);

SQL 数据适配器插入命令

走过海棠暮 2024-11-04 04:31:38

对于初学者来说, shutdown 命令本身可以直接花费一些时间,您不需要为此使用 at (请参阅 http://www.computerhope.com/unix/ushutdow.htm)。

不过,除此之外,我认为这种方法没有任何问题,只要您的环境可以容忍这些服务器离线时间可能超过必要时间(即,如果停电持续晚上 9 点到 10 点,但您不启动它们)直到第二天早上 8 点才回来,这比他们真正需要的时间长了 10 个小时),你的描述似乎表明情况就是如此。在这种环境中,除了安排主机在虚拟机计划关闭几分钟后关闭之外,我认为我不会做任何不同的事情。

For starters, the shutdown command can take a time directly itself, you don't need to use at for that (see http://www.computerhope.com/unix/ushutdow.htm).

Beyond that, though, I don't see anything wrong with this approach, provided that your environment can tolerate those servers being offline potentially longer than necessary (i.e. if a power outage lasts from 9-10 pm, but you don't start them back up until 8 am the next morning, that's 10 hours longer that they were off than they really needed to be), which your description seems to suggest is the case. In this environment, I don't think I would do anything differently, beyond also scheduling the host computer to shutdown a couple of minutes after the VMs are scheduled to do so.

在断电时关闭和打开服务器和虚拟机的正确方法是什么?

走过海棠暮 2024-11-03 23:24:06

如果这是在 page_init 之后加载的 page_init 视图状态中,那么你的答案很简单。这里有 Pagelifecycle 的描述,加载视图状态发生在页面初始化事件之后。所以视图变量在 page_init 中不可用

your answer is easy if this is in page_init viewstate loads after page_init. Here you have the description of the Pagelifecycle which describes, that the load view state happens after the page init event. so the view variables are not available in the page_init

ViewStateUserKey 有时无法验证

走过海棠暮 2024-11-03 19:56:18
SELECT SQL_CALC_FOUND_ROWS 
  p.*,
  CASE p.in_stock_msg  WHEN '' THEN 'In stock' ELSE p.in_stock_msg  END AS in_stock_msg, 
  CASE p.out_stock_msg WHEN '' THEN ''         ELSE p.out_stock_msg END AS out_stock_msg,
  COALESCE(p1.product_id, p2.product_id) IS NOT NULL AS options_exist,
  i.thumbnail,i.thumbnail_width,i.thumbnail_height,
  i.title AS thumbnail_title, i.alt AS thumbnail_alt
FROM 
  product p 
  INNER JOIN category_2_product c2p ON p.merchant_id=c2p.merchant_id 
                                       AND p.product_id=c2p.product_id 
                                       AND c2p.category_id = 84
  LEFT  JOIN product_image        i ON p.merchant_id = i.merchant_id
                                       AND p.product_id = i.product_id
                                       AND i.is_default = 1 
  LEFT JOIN (
    SELECT product_id
      FROM product_option
     WHERE merchant_id = 116
     GROUP BY product_id) p1 on p1.product_id = p.product_id
  LEFT JOIN (
    SELECT product_id
      FROM package_2_product
     WHERE merchant_id = 116
     GROUP BY product_id) p2 on p1.product_id is null and p2.product_id = p.product_id

WHERE 
  p.merchant_id = 116
  AND FIND_IN_SET('live',p.param) > 0
  AND FIND_IN_SET('wholesale-only',p.param) = 0
ORDER BY
  p.rank, p.product_name

注意:

  • on p1.product_id is null 添加到第二个左连接,以防止当 p1 已经有结果时执行它。
  • group by 子句防止 LEFT JOIN 通过笛卡尔积扩展结果集

This DDL will create a table with enough fields to show the query working without errors.

create table product_option(merchant_id int, product_id int);
create table package_2_product(merchant_id int, product_id int);
create table category_2_product(merchant_id int, product_id int, category_id int);
create table product_image(merchant_id int, product_id int, is_default int,
    thumbnail int, thumbnail_width int, thumbnail_height int, title int, alt int);
create table product(merchant_id int, product_id int, in_stock_msg int,
    out_stock_msg int, param int, rank int, product_name int);
SELECT SQL_CALC_FOUND_ROWS 
  p.*,
  CASE p.in_stock_msg  WHEN '' THEN 'In stock' ELSE p.in_stock_msg  END AS in_stock_msg, 
  CASE p.out_stock_msg WHEN '' THEN ''         ELSE p.out_stock_msg END AS out_stock_msg,
  COALESCE(p1.product_id, p2.product_id) IS NOT NULL AS options_exist,
  i.thumbnail,i.thumbnail_width,i.thumbnail_height,
  i.title AS thumbnail_title, i.alt AS thumbnail_alt
FROM 
  product p 
  INNER JOIN category_2_product c2p ON p.merchant_id=c2p.merchant_id 
                                       AND p.product_id=c2p.product_id 
                                       AND c2p.category_id = 84
  LEFT  JOIN product_image        i ON p.merchant_id = i.merchant_id
                                       AND p.product_id = i.product_id
                                       AND i.is_default = 1 
  LEFT JOIN (
    SELECT product_id
      FROM product_option
     WHERE merchant_id = 116
     GROUP BY product_id) p1 on p1.product_id = p.product_id
  LEFT JOIN (
    SELECT product_id
      FROM package_2_product
     WHERE merchant_id = 116
     GROUP BY product_id) p2 on p1.product_id is null and p2.product_id = p.product_id

WHERE 
  p.merchant_id = 116
  AND FIND_IN_SET('live',p.param) > 0
  AND FIND_IN_SET('wholesale-only',p.param) = 0
ORDER BY
  p.rank, p.product_name

Notes:

  • on p1.product_id is null is added to the 2nd left join to prevent it being executed when p1 already has a result.
  • The group by clauses prevent the LEFT JOINs from expanding the result set via cartesian product


This DDL will create a table with enough fields to show the query working without errors.

create table product_option(merchant_id int, product_id int);
create table package_2_product(merchant_id int, product_id int);
create table category_2_product(merchant_id int, product_id int, category_id int);
create table product_image(merchant_id int, product_id int, is_default int,
    thumbnail int, thumbnail_width int, thumbnail_height int, title int, alt int);
create table product(merchant_id int, product_id int, in_stock_msg int,
    out_stock_msg int, param int, rank int, product_name int);

Mysql 查询优化,将 CASE Exists (SELECT...) 移至左连接

走过海棠暮 2024-11-03 19:21:49

这个例子中没有任何内容对我有用

for (var i = 0; i < res.results.length; i++) {
        $('#list_tags').append('<li class="dd-item" id="'+ res.results[i].id + '"><div class="dd-handle root-group">' + res.results[i].name + '</div></li>');
}

    $('.dd-item').click(function () {
    console.log($(this).attr('id'));
    });

Nothing from this examples , works for me

for (var i = 0; i < res.results.length; i++) {
        $('#list_tags').append('<li class="dd-item" id="'+ res.results[i].id + '"><div class="dd-handle root-group">' + res.results[i].name + '</div></li>');
}

    $('.dd-item').click(function () {
    console.log($(this).attr('id'));
    });

jquery:从类选择器获取id

走过海棠暮 2024-11-03 13:27:34

忽略代码中的(MANY)错误,您将 strcpy() 放在正确的位置。

但是,您没有使用正确的参数调用它:strcpy() 需要 2 个参数。
基本上,两者都是 char* 类型;您传递的是 charchar*,这就是编译器抱怨的原因(对于编译器来说,char 的行为类似于 int 所以它说“strcpy 从整数生成指针”)。

您需要检查数据结构并将正确的 char* 传递给 strcpy()

Ignoring the (MANY) errors in your code, you are putting the strcpy() in the right place.

However, you are not calling it with the correct arguments: strcpy() needs 2 arguments.
Basically, both are of type char*; you are passing a char and a char* and that is why the compiler complains (for the compiler the char behaves like an int so it says "strcpy makes pointer from integer").

You need to review your data structure and pass the right char*s to strcpy().

在 C 中标记字符串

走过海棠暮 2024-11-02 22:34:40

您到底看到了什么问题?你尝试了什么?

您能澄清一下这个问题吗,您似乎只是在寻找一种从另一个存储库中提取数据的方法,在这种情况下:

hg pull -r {RevisionYouWantFromOtherRepo} {pathToSecondRepository}

What problem are you seeing exactly? What have you tried?

Can you clarify the issue, it seems like you are just looking for a way to pull from another repo, in which case:

hg pull -r {RevisionYouWantFromOtherRepo} {pathToSecondRepository}

将更改从一个 HG 存储库转发到另一个

走过海棠暮 2024-11-02 21:10:22

使用 new 关键字初始化它的方式与使用 '=' 直接设置字符串的方式没有区别。内存都是在堆上分配的,因此垃圾收集器负责在内存超出范围时收集内存。唯一的区别是“new”调用构造函数,而如果直接使用 = 赋值,则会调用重载运算符并初始化字符串的新实例。

There is no difference between the way you initialize it with new keyword or when you directly set the string using '='. The memory is both allocated on the heap and so garbage collector is reponsible for collecting the memory once it goes out of scope. The only differentce is 'new' calls the constructor whereas if you directly assign using = the overloaded operator gets called and it initializes a new instance of the string.

.NET 中初始化字符串和不初始化字符串之间的区别

走过海棠暮 2024-11-02 17:44:44

似乎我的 -Xmx-选项出了问题 - 再试一次,现在可以了。

Seems like I got something wrong with the -Xmx-option - tried it again and it works now.

根据 JNI_CreateJavaVM 创建 JVM,收到 OutOfMemoryError

走过海棠暮 2024-11-02 11:40:29

如果用户调整字段大小,可能是因为他们希望(或需要)它变大1

在这种情况下,您应该考虑您的用户知道他们在做什么,这样做是因为他们想要/需要,并且他们会接受布局有点损坏,只要它允许他们使用该文本区域。

不过,如果您想这样做(您不应该),请引用如何禁用文本区域调整大小? :

textarea {
    resize: none;
} 

1.我看得不太清楚,当我缩放或使某些东西更大时,这是因为我也需要 - 并且,在这种情况下,我更喜欢布局有点破损的网站,而不是我无法使用的网站!

If users resize the field, it's probably because they want (or need) it to be bigger 1.

In such a case, you should consider your users know what they are doing, are doing it because they want / need to, and that they will accept the layout to be a little broken, provided it allows them to use that textarea.

Still, if you want to do that (you shouldn't), quoting How do I disable textarea resizing? :

textarea {
    resize: none;
} 

1. I don't see very well, and when I zoom, or make something bigger, it's because I need too -- and, in such a case, I prefer a layout a bit broken to a website I cannot use !

如何禁用用户动态调整多行输入大小?

更多

推荐作者

慕巷

文章 0 评论 0

浅生活

文章 0 评论 0

bal

文章 0 评论 0

lqwuliang

文章 0 评论 0

后来的我们

文章 0 评论 0

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文