Skip to main content

Posts

MIME message with mail

Content-ID and Message-ID Uniform Resource Locators Status of this Memo This document specifies an Internet standards track protocol for the Internet community, and requests discussion and suggestions for improvements. Please refer to the current edition of the "Internet Official Protocol Standards" (STD 1) for the standardization state and status of this protocol. Distribution of this memo is unlimited. Abstract The Uniform Resource Locator (URL) schemes, "cid:" and "mid:" allow references to messages and the body parts of messages. For example, within a single multipart message, one HTML body part might include embedded references to other parts of the same message. 1. Introduction The use of [MIME] within email to convey Web pages and their associated images requires a URL scheme to permit the HTML to refer to the images or other data included in the message. The Content-ID Uniform Resource Locator, "cid:", serves...

Remote Scripting with IFRAME

As web sites become more and more like traditional applications, the call-response-reload model used in HTTP transactions becomes increasingly cumbersome. Instead of delivering a single dynamic page, the DHTML or JavaScript developer must create a series of separate pages. The flow of the application is interrupted by page reloads whenever the client communicates with the server. Remote scripting provides a solution to this problem, easing development of complex JavaScript applications, and providing a better experience for the end user. What is Remote Scripting? Remote Scripting is the process by which a client-side application running in the browser and a server-side application can exchange data without reloading the page. Remote scripting allows you to create complex DHTML interfaces which interact seamlessly with your server. If you're not clear on exactly what this means, think of the ever-present JavaScript image swap (you've coded one of those, haven't you?). I...

Create sub domain application with PHP

First you need to set your main domain to act as a catch-all subdomain. its like putting ServerAlias * so that each subdomain which is requested to the main domain reaches the same place. I mean if your main domain root is /home/admin/abc.com/htdocs/ then your catch-all setup shall send all sub-domain requests to that same directory /home/admin/abc.com/htdocs/ and then in the index.php file of this directory you can do this global $domainname; global $subdomainname; $domainarray = explode('.', $_SERVER['HTTP_HOST']); $index=count($domainarray)-1; $domainname= $domainarray[$index-1].".".$domainarray[$index]; $subdomainname=""; for($i=0;$i { if($subdomainname=="") { $subdomainname=$domainarray[$i]; } else { $subdomainname=$subdomainname.".".$domainarray[$i]; } } ShowCustomizedPageForsubdomain($subdomainname); ?> This function ShowCustomizedPageForsubdomain($subdomainname) can be easily implemented in two ways: 1) Either your stor...

PHP OOP

New Functionality Support for PPP Exceptions Object Iteration Object Cloning Interfaces Autoload And much more, and it is faster too! The Basics The basic object operations have not changed since PHP 4. class my_obj { var $foo; function my_obj() { // constructor $this->foo = 123; } function static_method($a) { return urlencode($a); } } $a = new my_obj; // instantiate an object $a->my_obj(); // method calls my_obj::static_method(123); // static method call Similar, but not the same. While the syntax remains the same, internals are quite different.  Objects are now always being passed by reference, rather then by value. PHP 5 $a = new foo(); == PHP4 $a = &new foo(); While the old style constructors are supported, new more consistent mechanism is available. __construct() method. PPP Annoyance The VAR keyword for identifying class properties became deprecated and will throw an E_STRICT warning. PHP Strict Standards: var: Deprecated. Please ...

Language conversion with Google API and Ajax

Introduction The "Hello, World" of the Google AJAX Language API The easiest way to start learning about this API is to see a simple example. The following example will detect the language of the given text and then translate it to English. html > head > script type = "text/javascript" src = "http://www.google.com/jsapi" > script > script type = "text/javascript" > google . load ( "language" , "1" ); function initialize () { var text = document . getElementById ( "text" ). innerHTML ; google . language . detect ( text , function ( result ) { if (! result . error && result . language ) { google . language . translate ( text , result . language , "en" , function ( result ) { var translated = document . getElementById ( "translation" ); if ( result . translation ) { translat...