Google Ads

Proudly Hosted on

About Me

Hi, I 'm Aditya, the guy behind this website and many other. This site acts as my web playground, where I share all about me, my work and my knowledge.

I have over 8 yrs hands on experience in PHP, Mysql, JavaScript, open sources CMS like Joomla, Wordpress etc. During these 8 years, I have worked on more than 200 projects and/or websites but could not spare time for my blog.

 

 

Archive for the ‘Technology’ Category

After struggling for hours, I was able to configure my localhost to send email. This was working untill I upgraded by xampp to 1.8 on win 7 Pro.

So to help someone, I am listing the steps that I followed

Step – 1: Open php.ini and make some changes to [mail function]. The php.ini is under XAMPP\php\php.ini

SocialTwist Tell-a-Friend More
Tags: , ,   |  Posted under PHP, Technology, Website Development  |  Comments  Comments Off on Sending email from localhost
Last Updated on Wednesday, 13 August 2014 07:47

I was facing slow localhost issue from very long time on Win 7. I tried applying various fixes I found on the net. None really fixed it.

Finally, yesterday I found something which did the trick. 

Step 1: Type about.config in firefox. Settings will be opened.

Step 2: Search "network.dns.disableIPv6" and set it to true…You are done. 🙂

SocialTwist Tell-a-Friend More
Tags: ,   |  Posted under Technology, Website Development  |  Comments  Comments Off on How to fix slow localhost
Last Updated on Monday, 4 April 2016 03:52

 Shorthand for asynchronous JavaScript and XML, is a group of interrelated web development techniques used on the client-side to create interactive web applications. With Ajax, web applications can retrieve data from the server asynchronously in the background without interfering with the display and behavior of the existing page.

The use of Ajax techniques has led to an increase in interactive or dynamic interfaces on web pages. Data is usually retrieved using the XMLHttpRequest object. Despite the name, the use of JavaScript and XML is not actually required, nor do the requests need to be asynchronous.

AJAX is based on the following web standards:

  • JavaScript
  • XML
  • HTML
  • CSS

AJAX uses the XMLHttpRequest object

To get or send information from/to a database or a file on the server with traditional JavaScript, you will have to make an HTML form, and a user will have to click the "Submit" button to send/get the information, wait for the server to respond, then a new page will load with the results. Because the server returns a new page each time the user submits input, traditional web applications can run slowly and tend to be less user-friendly.

With AJAX, your JavaScript communicates directly with the server, through the JavaScript XMLHttpRequest object.

With the XMLHttpRequest object, a web page can make a request to, and get a response from a web server – without reloading the page. The user will stay on the same page, and he or she will not notice that scripts request pages, or send data to a server in the background.

To demonstrate the AJAX PHP connection we will create a very simple form with 2 input fields. In the first field you can type any text and we will send this text to our PHP script which will convert it to uppercase and sends it back to us

HTML code

<body>
	<form name="testForm">

	Input text: <input type="text" onkeyup="doWork();" 
	name="inputText" id="inputText" />

	Output text: <input type="text" name="outputText" 
	id="outputText" />

	</form>

</body>

1. First step

 // Get the HTTP Object 
 function getHTTPObject(){ 
 
	if (window.ActiveXObject) 

 		return new ActiveXObject("Microsoft.XMLHTTP"); 
  	else if (window.XMLHttpRequest) 
 
		return new XMLHttpRequest(); 
 
	else { 
 
		alert("Your browser does not support AJAX."); 
		return null; 
		} 
	}

2. Second Step

// Implement business logic 
 function doWork(){ 
 	 httpObject = getHTTPObject(); 
	 if (httpObject != null) {  
	 	httpObject.open("GET", "upperCase.php?
		inputText="+document.getElementById
		('inputText').value, true); 
		httpObject.send(null); 
		httpObject.onreadystatechange = setOutput; 
		} 
	 }

3. The last step on client side is to implement the setOutput() function which will change the value of our second field.

  • 0 = uninitialized
  • 1 = loading
  • 2 = loaded
  • 3 = interactive
  • 4 = complete
// Change the value of the outputText field 
 function setOutput(){ 
 	 if(httpObject.readyState == 4){ 
	 	document.getElementById('outputText').value 
		= httpObject.responseText; 
		} 
	 } 

 

Implementing the server side functionality is very simple compared to the client side. In the PHP code we just need to check the $_GET super-global array. Afterwards convert it to uppercase and echo the result. So the PHP code is this:

<?php if (isset($_GET['inputText']))
      	echo strtoupper($_GET['inputText']);
      ?>
SocialTwist Tell-a-Friend More
Tags: , ,   |  Posted under Ajax, PHP, Technology  |  Comments  Comments Off on AJAX
Last Updated on Saturday, 15 May 2010 11:54

A must watch video demos several tools that help the physical world interact with the world of data — including a deep look at his SixthSense device and a new, paradigm-shifting paper “laptop.”

SocialTwist Tell-a-Friend More
Tags: , , , ,   |  Posted under Technology  |  Comments  Comments Off on Must watch video
Last Updated on Thursday, 10 December 2009 05:57