HOME PHP C# C++ ShellExecute DateTime file_exists Random Random Number PHP Time Calculation array CGI C# CGI Sample C# CGI C# CGI Example GetEnvironmentVariable QUERY_STRING PostMessage mail Knuth if Referrer getenv Removable Disk Detection UDP UDP Receive BrowseDialog Datagram SOCK_DGRAM PHP_SELF Bubble Sort CAsyncSocket max_execution_time MFC CGI Example Number Format password bcsub 암호화 CGI Example preg_regreplace printf protection Calculator ASCII array_count_values Client/Server Delphi Internet Disable Session else count BinaryReader form handling formatted date time Content-Type include chunk_split gmdate HTTP Daemon HTTP Server HTTP Server Source HTTP_REFERER

GETENV.ZIP

How to get reffering URL ?   (created at Oct 15, 2007)   49  

Grabs the referring URL - get the HTTP_REFERER and save it to a variable.code snippet:

Simple CGI Programming in C   (created at Aug 27, 2007)   83  

Here's the simplest C based CGI example. #include #include int main(void){    char *data;    printf("Content-Type:text/html;xdxa"); ");&n...

How to make random number ?   (created at Oct 15, 2007)   61  

Generate a random number using mt_rand. From the php documentation- "If called without the optional min, max arguments mt_rand() returns a pseudo-random value between 0 and RAND_MAX. If you want a random number between 5 and 15 (inclusive), for example, us...

How to check if a file exists ?   (created at Oct 15, 2007)   54  

To determine whether a file exists on the server, PHP has a simple function: file_exists.

How to include a file with error reporting ?   (created at Oct 15, 2007)   55  

Sometimes you want to be able to give some feedback if a PHP include has failed. Here is a version using the fopen command, which can search the include path.

PHP if...else... example   (created at Oct 15, 2007)   74  

Followings are the basic example of an if then else control structure.

PHP form handling example in single page   (created at Oct 15, 2007)   78  

This example shows a very simple form together with the form handling process on a single page.got submission
";   ech...

How to convert formatted date time string to datetime?   (created at Oct 12, 2007)   74  

Whatever the formatted string is, strtotime() function convert the formatted date time string to datetime.Following example shows the simple reference can convert date time string whatever the formatted input is...function foo($formatted_time){  retur...

How to remove or set time limit that defined as max_execution_time in php.ini   (created at Sep 18, 2007)   69  

PHP provides the alternate function which can control time limit that defined in php.ini. Following is the alternate function can control time limit.void set_time_limit (int seconds);Set the number of seconds a script is allowed to run. If this is reached,...

Adding and Subtracting Time   (created at Sep 13, 2007)   65  

The time () function generates a long string of numbers representing how many seconds have passed since January 1, 1970. It is possible to add and subtract time by adding and subtracting seconds.

The three simplest regular expressions you will use in PHP   (created at Sep 12, 2007)   106  

The three most basic searches using regular expressions are searching for the strings start, the strings end, or for characters it contains. We can do these using the following symbols:^ indicates the string starts with the specified characters, so "^strcp...

How to run shell command by MFC ?   (created at Sep 09, 2007)   65  

Followings are the useful example can run shell command./*    Programmed 1998 by Kurapa Chunun Kang (kurapa@kurapa.com)    By below function, you can run shell command easily.*/#include void KShellExecute(HWND handle, LPCTST...

Binary Search Sample Code   (created at Sep 08, 2007)   78  

This is Binary search that returns a negative one if the number is not found.This code does a bubble sort and then proforms the binary search.#include

MFC based World Wide Web HTTP Server Source Code   (created at Aug 28, 2007)   87  

The below attachment is HTTP Server source code that supports CGI. Detail Description: HTTPSVR is an MFC sample that demonstrates the use of MFC and its Windows Sockets (WinSock) classes in implementing a simple World Wide Web HTTP server. HTTPSVR turns an...

Creating and Using a CAsyncSocket Object to use CAsyncSocket   (created at Aug 28, 2007)   103  

Followings are the procedure to send/receive UDP packet by CAsyncSocket.STEP 1. ConstructionConstruct a CAsyncSocket object and use the object to create the underlying SOCKET handle.Creation of a socket follows the MFC pattern of two-stage construction.For...

UDP Send and Receive Using CAsyncSocket   (created at Aug 28, 2007)   48  

The following is sample code showing use of CAsyncSocket to send and receive UDP packets. I used the ClassWizard to create a class (CUDPSocket) derived from CAsyncSocket. The derived class does little more than override OnReceive. The derived class is used...

Using the shell to receive notification of removable media being inserted or removed   (created at Aug 28, 2007)   45  

Recently I needed to determine when removable media, such as a zip disk or media card, had been inserted by the user. I initially looked into the WM_DEVICECHANGE broadcast message only to realise this supports CDROMs and little else. Fortunately there is a...

Fast and Good Keyboard/Mouse Test without the message handler   (created at Aug 27, 2007)   97  

In this short snippet, I will show you a Win32 function that checks whether a button is pressed or not. The good thing is that you don't need to handle the WM_KEYDOWN message. The second advantage is that it is really easy to use and that it can be used ev...

C++ CGI Example working on Apache   (created at Aug 27, 2007)   60  

In this short howto I will explain how to setup your apache webserver to run any compiled application as an CGI script and show a little example program to explain the main concepts. So why does someone might have the idea to execute an application? There ...

Simple C# CGI working on Apache   (created at Aug 27, 2007)   38  

Simple program to demonstarte the power of c# on the Net. This program require web server e.g(java web server ,apache etc).Hello.csclass zzz{  public static void Main()  {    System.Console.WriteLine("Content-Type:text/html ");  &n...

How to send binary data through C# CGI app?   (created at Aug 27, 2007)   67  

Following example implemented binary data downloading.using System;using System.Collections.Generic;using System.Text;using System.IO;namespace cscgi{  class CsCGI  {    private static string dbgString = "id=1234&pic=123.gif";  &nb...

Send email Message With PHP   (created at Aug 25, 2007)   80  

This source code describes how to send email with php with headers

Array_count_values   (created at Aug 25, 2007)   112  

This code prints array count values

Calculator with basic four functions   (created at Aug 25, 2007)   70  

See below as calculator with basic four functions.
1st number:
2nd number:

What operation would you like to perform?

Number Format   (created at Aug 25, 2007)   68  

In this article we'll make number format like 0001, 0002, 0003 in stead of 1, 2 ,3. It's very easy to do this for your counter, category or product ID. etc.

A Function Returns Large Random Numbers   (created at Aug 25, 2007)   62  

This basically randomly pick a number between the min and max values. This is made because the rand() and mt_rand() function can not accept numbers larger than 2^31 or 2^63,depend on your processor and complier.

Function AccountCryptPassword($password,$salt)   (created at Aug 25, 2007)   89  

Encryption and password account accessFunction AccountCryptPassword($password,$salt) {  if($salt=="")  {   srand(time());   $random=rand();   $itoa64="./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; &n...

Cardinal Endings   (created at Aug 25, 2007)   65  

This php based script will find numbers and give them a cardinal ending. This can be useful for displaying rankings or results of a competition. The script is easy to install and use

URL Rewriter PHP   (created at Aug 25, 2007)   112  

URL Rewriter PHP is a short code that can be used to rewrite dynamic PHP urls as URL's that link to static html pages. Increases search engine ranksings by creating a static system of page linking as well as making all content available

Browser detection in PHP   (created at May 21, 2007)   90  

Sometimes, you may want to know what kind of browser is connecting to your web site. Actually such kind of information is usually stored in $_SERVER.  Below is the reference: