header

HTTP headers for jpg files after mod_rewrite

Hello, I'm using Apache's mod_rewrite to route requests for .jpg files to a directory outside my web root. It generally has been fine, but there are a few images that do not display. I then realized that when I use PHP's get_headers() function on my image URLs, they are all returning "Content-Type: text/html; charset=UTF-8" instead ...

How to add user id in Excel header / footer?

Does anyone know how to add user id to the Excel header or footer? I know I can set it in a macro but I'm trying to avoid it. Is there any shortcut like &D or &t for user id? ...

sending a charset in the Content-Type header

i use jquery $ajax to post a contact form to my email. but encoding is wrong and i see question marks. i figured i should set the content-type but cant manage to do so. am using asp thx ...

How to define (non-method) functions in header libraries

When writing a header library (like Boost), can one define free-floating (non-method) functions without (1) bloating the generated binary and (2) incurring "unused" warnings? When I define a function in a header that's included by multiple source files which in turn is linked into the same binary, the linker complains about redefinition...

Apache is not sending "Connection" header for static application/x-javascript files

I am trying to debug some slowness in a site and I discovered that KeepAlive was disabled and that most of the content was being served with Connection: close. After enabling KeepAlive, most of the pages started to serve Connection: keep-alive headers but now I have noticed that some of the static JavaScript files are being served with n...

HTTP Preauthorization

At http://localhost/tmp/ I have a form that asks for the user and password (authentication). After the user posts (hits OK) I want to redirect the user to http://localhost/test/ which uses Apache's Basic AuthType. Happens that the user and password just typed in the form are exactly the credentials to authenticate at http://localhost/tes...

Mixing GET with POST - is it a bad practice?

Is it a bad practice to mix GET and POST? (note this is in PHP) e.g. <form action="delete.php?l=en&r=homepage" method="post"> <!-- post fields here --> </form> ...

<thead> and <tfoot> in Safari

I trying to print a page with multiple tables. The problem is that any of these tables may break and carry over to the next page. Have been trying to get the table header to repeat on the second page. Am currently using thead and setting the display property to table-header-group. This works just as expected in IE and firefox but the...

How to detect auto responders

I have written a php e-mail processing client that uses the IMAP protocol. I noticed that it processes auto responders like normal e-mails which is undesirable. Is there something in the mail header that would indicate that the e-mail is not from a human but from an auto/vacation responder? Any help would be appreciated. ...

Adding mail header if postfix DNS based RBL (realtime black hole) check fails

Hello, I have setup a receiving Postfix mail server. Here i have custom code written that parses the whole mail received by postfix and use the headers, body and attachments separately for different uses. I have currently added SPF and DKIM checks in postfix that result in appending of their results in the mail header to indicate about...

the header is being ignored

<? session_start(); $id = $_SESSION['id']; $email = $_COOKIE['email']; $password = $_COOKIE['password']; header('Location: ../'); // I tell it to redirect... $cookie_expires = time() + 60*60*24; $cookie_path = '/'; $cookie_name = 'temporary'; $cookie_value = 'Your account was deleted.'; setcookie($cookie_name, $cookie_value, $cookie_expi...

Downloading files with PHP - Only downloading one at a time!

Hi there, I have a PHP file that serves up a file, but the problem is that no matter what browser is being used, if you click on 2 links that go to 2 separate files, the second download doesn't start until the first one is complete! Any ideas? Download Code header('Content-Type: application/octet-stream'); header('Content-Description:...

What's the rationale behind the HTTP Date header?

I have read RFC 2616, but still I wonder, what the Date field is for. There is the Last-Modified field, that actually has a meaning besides just serving metadata, that is, for caching ('If-Modified-Since'). But what use has it to double the info in a separate Date header? ...

Parsing variable length descriptors from a byte stream and acting on their type

I'm reading from a byte stream that contains a series of variable length descriptors which I'm representing as various structs/classes in my code. Each descriptor has a fixed length header in common with all the other descriptors, which are used to identify its type. Is there an appropriate model or pattern I can use to best parse and r...

javascript browser-like GET request

I need to request web page client-side and than pass it to server as a string. I tried jQuery: $.get( "http://example.ru/", {name:"Joe", age:"42"}, function(data){ $.get( "script.php", {data:data, query:query}, ) }); }); but did not succeed. I suspect it failed because of custom ...

Can you give me examples of odd single line comments in C++?

I wrote a method to remove single line comments from a C++ source file: def stripRegularComments(text) { def builder = new StringBuilder() text.eachLine { def singleCommentPos = it.indexOf("//") def process = true if(singleCommentPos > -1) { def counter = 0 it.eachWithIndex { obj,i -> if((obj == '\'')...

Is Content-Type meta tag important if responce headers include content-type?

At the moment we set content-type in our responce headers, a bit like this... Content-Type text/html; charset=utf-8 We also have this at the top of html pages... <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt; <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" ...

Can I mix JNI headers implementation with normal C++ classes?

If I try to implement my class on this file I get an error UnsatisfiedLinkError, however if I remove the implementation of the Broker.h Class it goes ok. Why? Broker.h #include "XletTable.h" #ifndef BROKER_H_ #define BROKER_H_ class Broker { private: static Broker* brokerSingleton; static XletTable *table; // Private con...

How to minimize the amount of place used by GPL copyright notice?

Gnu GPL page advocates a following header in each file of GPL project: This file is part of Foobar. Foobar is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your optio...

custom header issue in forwarding/replying mails

Sir,i have sent a mail by adding custom header by using .net aaplication like this myCH.Add("X_Company", "MCL"); myCH.Add("X_ID", "A1000"); myCH.Add("X-Y: Z", "ganesh"); myCH.Add("X-Original-ID", "123"); myCH.Add("X-Origin-ID", "12356"); but ,when i am from netscape browswer,forwarding this mail or replying to anyone then it has no tha...