Posts Tagged ‘HTML’

Online HTML to PDF Converter

Wednesday, March 4th, 2009

It’s a simple service to convert the web pages to PDF files. No need to install applications on your computer.
It’s free and without registration!

Enter your URL &  Click button  to create a PDF file.

I converted one of my site. Completed in about 30 seconds.

We saved successfully downloaded to your desktop. PDF is quite accomplished in the sort of outcome, as the screenshots. 

HTML-PDF-converter.com

html2pdf

Mapping .html file to ASP.NET

Tuesday, February 24th, 2009

Step one: Open IIS, in your site to set up virtual directory property page tab, click on the “Application Settings (Application Settings)” under the “configuration (Configuration..)” Button, open the “application configuration (Application Configuration ) “window” App Mappings (App Mappings) “Tab page, click on the” Add (Add..) “button, the pop-up” Add / Edit Application Mapping suffix (Add / Edit Application Extension Mapping ) “window, in the” executable program (Executable) “the right of the text box, type C: \ WINNT \ Microsoft.NET \ Framework \ v1.1.4322 \ aspnet_isapi.dll (file path will be. net framework version of the different different for the sake of safety, you can in the “App Mappings (App Mappings)” tab under the list of double-mapping “. aspx”, in the pop-up window to select its “executable program (Executable)” text Copy the text box and then out), in the “name suffix (Extension)” text box you want to add the suffix of “. html”, then click OK to save all open windows to complete the property settings in IIS; 

Step two: open you want to configure the site or virtual directory under the root directory of the web.config file, configuration section in <system.web> add the following configuration sections: 

<httphandlers>
<add verb=”*”
path=”*.html”
type=”System.Web.UI.PageHandlerFactory” />
</httphandlers>


Save web.config file, Now we are set !!! :-)

AJAX Registration Page

Wednesday, February 18th, 2009

Here AJAX Registration Page with HTML & Javascript. Checking username, length, password match..

live_previewLive Preview downloadDownload

$(document).ready() :

The most commonly used command in jQuery is $(document).ready(). It makes sure code is executed only when a page is fully loaded. We often place code blocks inside this $(document).ready() event.

?View Code JAVASCRIPT
 
<script type="text/javascript" src="jquery-1.2.6.min.js"></script>
 
// Your Code
 
$(document).ready(function()
 
{
 
// Put all your jQuery goodness in here.
 
}

Checking Username Length:

When guest types something in Username field less than 3 characters and focus move from it to next field. An error will be occurred .

username3

?View Code JAVASCRIPT
 
usr = $("#txt_username").val();
 
if(usr.length >= 3) //checking username length
{
	// Checking username code here..
}
 
else
{
	//Error Message code here..
 
}

Chekcing Username:

When guest types something in Username field greater than or equal 3 characters and focus move from it to next field Then, A waiting message will be displayed with small image as loader.gif.

checkingusername

?View Code JAVASCRIPT
$("#div_status").html('<img src="loader.gif" align="absmiddle">&nbsp;Checking username....');

If Username is available:

if username available from database. Ajax will display like this, Otherwise, An error will be occurred.

usernameready

?View Code JAVASCRIPT
	$.ajax({
    type: "POST",
    url: "check_username.php",
    data: "username="+ usr,
    success: function(msg){
   $("#div_status").ajaxComplete(function(event, request, settings){
 
	if(msg == 'OK')
		{
			// If the username available, goes here.
		}
		else
		{
			//If the username not available, goes here.
		}

Checking Password:

When guest types something in password field less than 3 characters and focus move from it to next field. An error will be occurred .

password3

?View Code JAVASCRIPT
 
var str_confirm_password = $("#txt_confirm_password").val();
 
if(str_password.length  >=3)
{
	// Checking Password match code here..
}
else
{
	// Error message code here..
}

Checking Password Match:

When guest types something in Password & Confirm Password fields, and focus move from it to next field. Then, it will check value of both fields. If both field’s value are not same then, an error will be displayed.

If not match

passwordnotmatch

If match

passwordready

?View Code JAVASCRIPT
var str_password = $("#txt_password").val();
var str_confirm_password = $("#txt_confirm_password").val();
 
if(str_password!=str_confirm_password)
{
	// If not match, goes here,
}
else
{
	//If match, goes here.
}

“Sign Up Now” Button :

When guest push “Sign Up Now!” button. It goes to next page .

?View Code JAVASCRIPT
function fn_onclick() {
	if(str_status == "OK" && str_pwd_status =="OK" && str_password != '' && str_confirm_password != '' )
	{
		$("#div_msg").html('<div id="logged_in"> <br />' +
    	 'Thanks for Registering <br />' +
   		  '<img align="absmiddle" src="loader_bar.gif">' +
    	 '<br /> Please wait while we redirect you to welcome page...</div>');
 
		setTimeout('go_to_next_page()', 4000);
	}
}
 
function go_to_next_page()
{
	window.location = 'welcome.html';
}

.removeClass() & .addClass() functions :

.removeClass() & .addClass() functions are used for add styles into username & password fields. In code, ‘css_ok’ & ‘css_error’ regarding from ‘style.css’ . For instance these functions show the box green if the values entered in the boxes are correct & otherwise red color

.

?View Code JAVASCRIPT
<link rel="stylesheet" type="text/css" href="style.css" />
 
	// Your code here..
 
$("#txt_username").removeClass('css_ok');
$("#txt_username").addClass("css_error");

In style.css,

.css_ok
{
border: 1px solid green;
color: #333333;
}
.css_error
{
border: 1px solid #AC3962;
color: #333333;
}

live_previewLive Preview downloadDownload

Ajax Based Search Engine With PHP and XML

Sunday, February 15th, 2009

Here Sample code of Ajax based search engine with PHP and XML

live_preview Live Preview          downloadDownload Code

 

This is the Javascript Code :

?View Code JAVASCRIPT
/* &lt;--------------------------&gt; */
/* XMLHTTPRequest Enable		*/
/* &lt;--------------------------&gt; */
function createObject() {
var request_type;
var browser = navigator.appName;
if(browser == "Microsoft Internet Explorer"){
request_type = new ActiveXObject("Microsoft.XMLHTTP");
}else{
request_type = new XMLHttpRequest();
}
return request_type;
}
 
var http = createObject();
 
/* &lt;--------------------------&gt; */
/* 		SEARCH				   */
/* &lt;--------------------------&gt; */
 
function fnSearchName() {
 
txtInput=encodeURI(document.getElementById('txtInput').value);
 
document.getElementById('divmsg').style.display = "block";
document.getElementById('divmsg').innerHTML = "Searching for <strong>" + txtInput+"</strong>";
// Set te random number to add to URL request
nocache = Math.random();
http.open('get', 'php_Search.php?name='+txtInput+'&amp;nocache = '+nocache);
 
http.onreadystatechange = fnSearchNameReply;
http.send(null);
}
function fnSearchNameReply() {
 
	var response = http.responseText;
	document.getElementById('divResult').innerHTML=response;
 
}

This is the PHP Code :

load("NameList.xml");
$x=$xmlDoc-&gt;getElementsByTagName('NAME');
for ($i=0; $i&lt;=$x-&gt;length-1; $i++)
{
//Process only element nodes
if ($x-&gt;item($i)-&gt;nodeType==1)
  {
  if ($x-&gt;item($i)-&gt;childNodes-&gt;item(0)-&gt;nodeValue == $q)
    {
    $y=($x-&gt;item($i)-&gt;parentNode);
    }
  }
}
$cd=($y-&gt;childNodes);
for ($i=0;$i&lt;$cd-&gt;length;$i++)
{
//Process only element nodes
if ($cd-&gt;item($i)-&gt;nodeType==1)
  {
  echo($cd-&gt;item($i)-&gt;nodeName);
  echo(": ");
  echo($cd-&gt;item($i)-&gt;childNodes-&gt;item(0)-&gt;nodeValue);
  echo("");
  }
}
 
?&gt;