• support[@]kurinchilion.com
  • +1 (888) 666-4252

PHP: How to receive the posted XML data?

Oct 05, 2009 - by kurinchilamp 411 Views
Receive the posted XML data In order to test the posted data, we can create a file creation steps to ensure that we receive the posted data via the $_POST array
<?php
/* 
  File name: postdata2.php
*/
    $xmlFile = "xmlFile.txt";
    $fh = fopen($xmlFile, 'w') or die("Cannot open file");
    fwrite($fh, $_POST["xmldata"]);
    fclose($fh);



?>
Continue Reading

PHP: How to post XML data using CURL?

Oct 04, 2009 - by kurinchilamp 485 Views
During integration projects or during such similar situations you may have across a necessity to transfer XML data or plain text file across server locations. Curl comes in handy during such scenarios. Following program is used to post XML data using Curl. In order for Curl to function, ensure that PHP settings has the curl module installed and that the libraries/dll libeay32, ssleay32 is installed in your server.
<?php
/* 
  File name: postdata.php
*/

$post_url = "http://localhost/demo/postdata2.php";
$xml_string = '<?xml version="1.0" encoding="UTF-8"?>
<books>
<book isbn="978-1594489587">
    <title>The Brief Wondrous Life of Oscar Wao</title>
    <publisher>Riverhead Hardcover </publisher>
    <amazon_price>14.97 </amazon_price>
    <author_firstname>Junot </author_firstname>
    <author_lastname>Diaz </author_lastname>
  </book>
<book isbn="999-1594489501">
    <title>A Thousand Splendid Suns </title>
    <publisher>Riverhead Hardcover </publisher>
    <amazon_price>14.27 </amazon_price>
    <author_firstname>Khaled </author_firstname>
    <author_lastname>Hosseini </author_lastname>
  </book>
</books>';


$ch = curl_init($post_url);

curl_setopt ($ch, CURLOPT_POST, true);
curl_setopt ($ch, CURLOPT_POSTFIELDS, "xmldata=".$xml_string);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_VERBOSE, 1);


$data = curl_exec($ch); 
// to get information on the curl resultset
$info = curl_getinfo($ch);

if(curl_errno($ch)){
    print curl_error($ch);
}

curl_close($ch);

?>
Continue Reading

Javascript Memory Leak Diagnosis

Oct 03, 2009 - by kurinchilamp 332 Views
What is meant by Memory leak? Memory leakage refers to obtrusive memory handling techniques adopted in programs which leads to increased load time and poor performance. Various scenarios can cause memory leaks which can range from unhandled memory garbage to cyclic references to error in code logic. One best suggestion given in the javascript forums to overcome this problem is to nullify the element once its usage is over. (more…)
Continue Reading

Javascript code organization for optimized performance

Oct 01, 2009 - by kurinchilamp 475 Views
Knowing how javascript code gets executed in a browser will help us organize the libraries or functions for better performance. Javascript unlike the server side scripting languages like PHP, ASP, Perl is not compiled at the server side. It is sent as-is from the server to the browser client and it is the browser that interprets the code at the client side. The total size of the Javascript code and its organization will have a significant effect on the pages served at the client side which in turn will affect the performance of the page. Organize the libraries in such a fashion that you only have the needed functions associated with the page. You can consider this point right at the time of creating your template pages. This will reduce the number of javascript pages that are called from one page. (more…)
Continue Reading

How to reset the screen terminal output?

Sep 29, 2009 - by kurinchilamp 434 Views
You might have come across instances like trying to print or output the content of binary files or similar instances when the screen spews out unreadable set of characters which then would disrupt the normal display of characters. "stty" is the command that is used to reset your screen content. $ stty sane
Continue Reading

Headstart to capture screenshot of web pages

Sep 24, 2009 - by kurinchilamp 384 Views
Following plugins will help you create php/perl/ruby module that will grab a screen shot of the web page Thumbshots.org or Thumbshots.com Thumbalizr PageGlimpse SnapCasa
Continue Reading

TECHNOLOGY DEV STACK

Following are some of the technologies that we use to build and maintain solutions for our clients.