All Questions

839
votes
11answers
952435 views

How to fix "Headers already sent" error in PHP

When running my script, I am getting several errors like this: Warning: Cannot modify header information - headers already sent by (output started at /some/file.php:12) in /some/file.php on line 2...
571
votes
15answers
619738 views

Returning JSON from a PHP Script

I want to return JSON from a PHP script. Do I just echo the result? Do I have to set the Content-Type header?
175
votes
17answers
213053 views

Parsing CSV files in C#, with header

Is there a default/official/recommended way to parse CSV files in C#? I don't want to roll my own parser. Also, I've seen instances of people using ODBC/OLE DB to read CSV via the Text driver, and a ...
373
votes
13answers
299114 views

How to use HTML to print header and footer on every printed page of a document?

Is it possible to print HTML pages with custom headers and footers on each printed page? I'd like to add the word "UNCLASSIFIED" in Red, Arial, size 16pt to the top and bottom of every printed page, ...
49
votes
6answers
22245 views

Why I have to call 'exit' after redirection through header('Location..') in PHP?

You know that if you want to redirect an user in PHP you can use the header function: header('Location: http://smowhere.com'); It is also well known that it is a good practice to put also an exit; ...
26
votes
6answers
49774 views

C++ #include guards

SOLVED What really helped me was that I could #include headers in the .cpp file with out causing the redefined error. I'm new to C++ but I have some programming experience in C# and Java so I coul...
53
votes
10answers
54433 views

PHP generate file for download then redirect

I have a PHP app that creates a CSV file which is forced to download using headers. Here's the relevant part of the code: header('Content-Type: application/csv'); header("Content-length: " . filesi...
123
votes
7answers
248847 views

jQuery and AJAX response header

So I've got this jQuery AJAX call, and the response comes from the server in the form of a 302 redirect. I'd like to take this redirect and load it in an iframe, but when I try to view the header info...
646
votes
19answers
424799 views

In Node.js, how do I "include" functions from my other files?

Let's say I have a file called app.js. Pretty simple: var express = require('express'); var app = express.createServer(); app.set('views', __dirname + '/views'); app.set('view engine', 'ejs'); app.ge...
86
votes
6answers
223598 views

How to add an Access-Control-Allow-Origin header

I am designing a website (e.g. mywebsite.com) and this site loads font-face fonts from another site (say anothersite.com). I was having problems with the font face font loading in Firefox and I read o...

Previous Next