标签: header

显示名称而不是电子邮件的电子邮件标题的格式是什么?

我正在尝试创建一个php脚本,它将使用mySQL数据库为我处理邮件列表,而且我已经完成了大部分工作.不幸的是,我似乎无法使标题正常工作,我不确定问题是什么.

$headers='From: noreply@rilburskryler.net \r\n';
$headers.='Reply-To: noreply@rilburskryler.net\r\n';
$headers.='X-Mailer: PHP/' . phpversion().'\r\n';
$headers.= 'MIME-Version: 1.0' . "\r\n";
$headers.= 'Content-type: text/html; charset=iso-8859-1 \r\n';
$headers.= "BCC: $emailList";
Run Code Online (Sandbox Code Playgroud)

我收到的结果是:

"noreply"@ ryburskryler.net rnReply-To:noreply@rilburskryler.netrnX-Mailer:PHP/5.2.13rnMIME- Version:1.0

php email header

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

函数默认参数和标题

我是C++的新手.我在设置标题时遇到问题.这是来自functions.h

extern void apply_surface(int, int, SDL_Surface *, SDL_Surface *,SDL_Rect *);
Run Code Online (Sandbox Code Playgroud)

这是functions.cpp的函数定义

void
apply_surface(int x, int y, SDL_Surface * source, SDL_Surface *
destination,SDL_Rect *clip = NULL)
{
    ...
}
Run Code Online (Sandbox Code Playgroud)

这就是我在main.cpp中使用它的方式

#include "functions.h"
int
main (int argc, char * argv[])
{
    apply_surface(bla,bla,bla,bla); // 4 arguments, since last one is optional.
}
Run Code Online (Sandbox Code Playgroud)

但是,这不会编译,因为,main.cpp不知道last参数是可选的.我怎样才能做到这一点?

c++ header

48
推荐指数
2
解决办法
4万
查看次数

在两个curl请求之间保存cookie

我知道使用cURL我可以看到我收到的cookies /标题

curl --head www.google.com
Run Code Online (Sandbox Code Playgroud)

而且我知道我可以使用标题添加标题

curl --cookie "Key=Value" www.google.com
Run Code Online (Sandbox Code Playgroud)

我目前正在测试一个需要持久性cookie的问题,并且可能存在很多问题.

如何在两个cURL请求之间有效地保留cookie ?

如果可能,使用临时文件进行存储.

cookies curl header http

48
推荐指数
4
解决办法
5万
查看次数

在标题中用作函数参数的"原始"类型前面删除"const"是否更好?

在代码审查过程中,我的一位同事向我提到,在标题中用作函数参数的"原始类型"前面的"const"是没有意义的,他建议删除这些"const".在这种情况下,他建议仅在源文件中使用"const".原始类型表示诸如"int","char","float"等类型.

以下是示例.

example.h文件

int ProcessScore(const int score);
Run Code Online (Sandbox Code Playgroud)

example.cc

int ProcessScore(const int score) {
  // Do some calculation using score
  return some_value;
}
Run Code Online (Sandbox Code Playgroud)

他的建议如下:

example.h文件

int ProcessScore(int score);  // const is removed here.
Run Code Online (Sandbox Code Playgroud)

example.cc

int ProcessScore(const int score) {
  // Do some calculation using score
  return some_value;
}
Run Code Online (Sandbox Code Playgroud)

但我有点困惑.通常,用户只会查看标题,因此如果标题和源文件之间存在不一致,则可能会导致混淆.

有人可以给出一些建议吗?

c++ const header primitive-types

48
推荐指数
4
解决办法
4875
查看次数

转发声明一个STL容器?

是否可以在头文件中转发声明STL容器?例如,请使用以下代码:

#include <vector>

class Foo
{
private:
    std::vector<int> container_;
    ...
};
Run Code Online (Sandbox Code Playgroud)

我希望能够做到这样的事情:

namespace std
{
    template <typename T> class vector;
}

class Foo
{
private:
    std::vector<int> container_;
    ...
};
Run Code Online (Sandbox Code Playgroud)

可以这样做吗?

c++ header c++-standard-library

47
推荐指数
3
解决办法
2万
查看次数

PHP header()重定向与POST变量

我正在使用PHP,我正在创建一个表单发布到的操作页面.页面检查错误,然后如果一切正常,它会将它们重定向到已发布数据的页面.如果没有,我需要将它们重定向回到它们所处的页面,并显示错误和POST变量.以下是它如何运作的要点.

HTML看起来像这样......

<form name="example" action="action.php" method="POST">
  <input type="text" name="one">
  <input type="text" name="two">
  <input type="text" name="three">
  <input type="submit" value="Submit!">
</form>
Run Code Online (Sandbox Code Playgroud)

action.php看起来像这样......

if(error_check($_POST['one']) == true){
    header('Location: form.php');
    // Here is where I need the data to POST back to the form page.
} else {
    // function to insert data into database
    header('Location: posted.php');
}
Run Code Online (Sandbox Code Playgroud)

如果出现错误,我需要将其POST回第一页.我不能使用GET,因为输入太大了.如果可能的话,我不想使用SESSION.这可能吗?

html php post header

47
推荐指数
3
解决办法
24万
查看次数

如何在JAX-RS中设置响应头,以便用户看到Excel的下载弹出窗口?

我编写了使用REST JAX-RS生成Excel文件的代码,并确认生成的Excel文件位于GlassFish服务器目录中.

但我的目标是当用户点击按钮(生成Excel .xls)时,我想要下载弹出窗口,询问用户是否保存或打开.xls文件,就像任何其他Web服务用于下载任何类型的文件一样.

根据我的搜索,步骤是:

  1. 生成Excel .xls(DONE)

  2. 将excel写入流

  3. 在JAX-RS文件中,将响应头设置为类似的,

    String fileName ="Blah_Report.xls"; response.setHeader("Content-Disposition","attachment; filename ="+ fileName);

我的问题是我在JAX-RS文件中做了所有这些,而且我没有可用的HttpServletResponse对象.

根据Add Response Header到JAX-RS Webservice的答案

他说:

您可以通过Web服务中的@Context注释注入对实际HttpServletResponse的引用,并使用addHeader()等来添加标头.

如果没有示例代码,我无法确切地说明这意味着什么.

java rest header jax-rs glassfish-3

47
推荐指数
2
解决办法
10万
查看次数

如何配置sqlite以默认显示标头

有没有办法配置sqlite3,以便默认显示标题?

我知道我可以.headers on用来打开标题,但每次启动客户端时我都要继续键入它,因为设置不会在会话之间粘连.我希望标题永久保存.

sqlite config header

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

<string>和<string.h>之间的区别?

怎么来这个代码

std::map <std::string , int> m;
m["a"]=1;
Run Code Online (Sandbox Code Playgroud)

编译(我正在使用MSVC 2010)

#include <string>
Run Code Online (Sandbox Code Playgroud)

但没有

#include <string.h>
Run Code Online (Sandbox Code Playgroud)

c++ string header header-files

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

如何在滚动上修复标题

我正在创建一个标题,一旦滚动到一定数量的像素,它就会修复并保持原位.

我可以使用css和html这样做,还是我也需要jquery?

我已经创建了一个演示,所以你可以理解.任何帮助都会很棒!

http://jsfiddle.net/gxRC9/4/

body{
    margin:0px;
    padding:0px;
}
.clear{
    clear:both;
}
.container{
    height:2000px;
}
.cover-photo-container{
width:700px;
height: 348px;
margin-bottom: 20px;
background-color:red;
}

.small-box{
    width:163px;
    height:100px;
    border:1px solid blue;
    float:left;
}

.sticky-header{
    width:700px;
    height:50px;
    background:orange;
    postion:fixed;
}
Run Code Online (Sandbox Code Playgroud)

css jquery header fixed

47
推荐指数
8
解决办法
22万
查看次数