Today's Question:  What does your personal desk look like?        GIVE A SHOUT

SEARCH KEYWORD -- Header



  The header element in HTML 5

Currently HTML5 is exciting and anyone who want to builds web pages is looking forward to implementing HTML5 new tags into their sites. Definitely HTML5 tags are very rich in functions that make life much easier for both webmasters and end users Within the HTML5 specfication we can see that there have been a significant number of new tags added, one of these the <header> element is what we’ll be covering here. We will talk about when to use it, when not to use it. As we ar...

   HTML5,Header     2012-05-03 09:12:58

  Output a file with HTTP range header in PHP

When downloading a large file, we may encounter some network issues which causes download termination and only part of the file is downloaded. When the network connection resumes next time, we may need to redownload the file again from the beginning. In order to save bandwidth, http provides a Range parameter in its header which can control the file transfer flow. With the range parameter in the header, we can resume the download from where we stop. Here is a piece of PHP code snippet which uses...

   PHP, range,http, file transfer     2013-01-09 05:55:05

  Handle ”cannot modify header information – headers already sent by”

Man PHP developers should encounter ”Warning: Cannot modify header information – headers already sent by ….” error before when executing a PHP script. Here are some solutions to this error. 1. Blank line Check whether there is any blank line after , especially in the files which are used in include() and require(0, some problems are caused by blank lines. 2. Add exit() after head() header (“Location: xxx”); exit(); 3. Use output cache <?php ob_start(); ...

   header sent, PHP error handle     2012-11-17 08:45:22

  Differences among Enter,F5 and Ctrl+F5 in webpage refresh

When we press Enter, F5 or Ctrl+F5 to refresh a webpage, is there any difference among them? Actually it's yes, we can find the difference from the request header and response header information. There are two cases about pressing Enter in the address bar. First if the page requested is cached and not expired in the browser, we can find the header information sent by the browser is : Host 192.168.3.174:8080 User-Agent Mozilla/5.0 (Windows NT 5.1; rv:5.0) Gecko/20100101 Firefox/5.0 Accept ...

   Refresh,F5,Ctrl+F5     2013-06-13 22:03:35

  Exit main thread and keep other threads running in C

In C programming, if using return in main function, the whole process will terminate. To only let main thread gone, and keep other threads live, you can use thrd_exit in main function. Check following code: #include #include #include int print_thread(void *s) { thrd_detach(thrd_current()); for (size_t i = 0; i < 5; i++) { sleep(1); printf("i=%zu\n", i); } thrd_exit(0); } int main(void) { ...

   C LANGUAGE,MULITHREAD,MAIN THREAD     2020-08-14 21:20:04

  Output control functions in PHP

The Output Control functions in PHP allow you to control when output is sent from the script. This can be useful in several different situations, especially if you need to send headers to the browser after your script has began outputting data. The Output Control functions do not affect headers sent using header() or setcookie(), only functions such as echo and data between blocks of PHP code. These output control functions include ob_start(0, ob_clean(),ob_get_contents(), etc. To be honest, I a...

   PHP,output buffer,relationship,ob     2012-06-15 10:11:58

  Socket programming tips in Solaris

I sponsored a topic in stackoverflow.com, and hoped the programmers can share the socket programming tips in different UNIX flavors. But unfortunately, the responders are few. So I can only share my socket programming tips in Solaris at here (the Chinese version can be found there): 1. Use the following link options: "-lresolv -lnsl -lsocket";2. Solaris doesn't provide socket options: SO_SNDTIMEO and SO_RCVTIMEO(Why does Solaris OS define SO_SNDTIMEO and SO_RCVTIMEO socket options...

   C,Solaris,socket,     2014-05-09 23:01:03

  Web Security: In-Depth Explanation of X-XSS-Protection

What is X-XSS-Protection X-XSS-Protection is an HTTP response header designed to enable or configure built-in cross-site scripting (XSS) filters in certain versions of Internet Explorer, Chrome, and Safari. The purpose of these filters is to detect reflected XSS attacks in the response and prevent the loading of pages, thereby protecting users from such attacks. The X-XSS-Protection response header was initially introduced by Microsoft in Internet Explorer 8 to control the browser's XSS filter. ...

   X-XSS-PROTECTION,WEB SECURITY,CONTENT SECURITY POLICY,XSS,CSP     2023-11-29 01:48:40

  A mini guide to HTTP referer

In HTTP header, there is a field named Referer which is to provide the referrer of the current accessed page. In this post, we will introduce the usage of HTTP referer field. On the web, when a user visits a webpage, s/he must be from some place. This place is usually referred a s referer. This information is very important to some website operators and server owners as they want to know where they get the traffic from and this helps them provide better service for potential targeted users. In t...

   HTML,HTTP REFERER,REFERRERPOLICY     2019-06-29 02:23:25

  How does Base64 work

Base64 is a data encoding scheme used in safe data transfer such as HTTP and its extensions. Base64 encoding can conver arbitrary group of bytes into a sequence of readable ASCII characters. These converted characters can safely put in a HTTP header without causing any problem while the peers process the HTTP header. Base64 encoding was invented as part of the MIME content transfer encoding. It is similar to other encoding schemes such as Uuencode and BinHex but with higher efficiency....

   ALGORITHM,BASE64     2016-03-09 23:47:40