Wednesday, January 9, 2013

Facebook Registration Form Plugin

Facebook Registration Plugin when we can use.just simple use this code into your website.Its completedone in Html IFrame.It's very easy.







Just Run this Code :

<iframe style="" src="https://www.facebook.com/plugins/registration? client_id=113869198637480& redirect_uri=https%3A%2F%2Fdevelopers.facebook.com%2Ftools%2Fecho%2F& fields=name,birthday,gender,password,location,email" frameborder="no" scrolling="auto" width="100%" height="330"></iframe>



 
 

Check Domain Name Using Php Script

We can check our DNS record to verify the existence of a domain name or not. We can see if facebook.com is there in DNS record by using checkdnsrr function. This function returns True if available and returns False if not available.The type can be A, MX, NS, PTR,SOA, AAAA, CNAME, SRV,A6 NAPTR, TXT or ANY.




Here is the simple code to check DNS records.

$domain="facebook.com";
if(!checkdnsrr($domain,'MX')) {
echo "Not there ";
}else {
echo " It is there "; }
 
//out put: It is there 

 

Create PDF File using Dompdf

The best option for creating pdf file or report,I suggest only Dompdf.The Dompdf is fullfill all requirement.In Dompdf you have to create simple pdf file,dynamic data file,generate database related pdf file.dompdf is an HTML to PDF converter. At its heart, dompdf is (mostly) CSS 2.1 compliant HTML layout and rendering engine written in PHP.dompdf is an HTML to PDF converter.


 
Download Dompdf :
  1. Link 1
  2. Link 2
  3. Link 3
Example For Create PDF :
$html = ("<html>");
 $html .= ("<head>");
 $html .= ("<style>");
 $html .= ("</style>");
 $html .= ("</head>");
 $html .= ("<body>");

$html.=("<table width='500' border='1' cellspacing='1' cellpadding='1'>\n");
$html .= ("<tr>");
$html .= ("<td>hello</td>");
$html .= ("<td>welcome</td>");
$html .= ("</tr>");
 $html .= ("</table>");
 $html .= ("<h2>Generated PDF</h2>\n");
 $html .= ("<p>date_today</p>\n");
 $html .= ("</div>");

 $html .= ("<p>$table->COMMENT</p>\n");

 $html .= ("</body>");
 $html .= ("</html>");

 function render($html,$filename)
 {
  require_once("../dompdf_config.inc.php");
  $dompdf = new DOMPDF();
  $dompdf->load_html($html);
  $dompdf->set_paper("a4", "landscape" );
  $dompdf->render();
  $dompdf->stream("$filename.pdf");
 }

 $filename = ("GeneratedPDF");

 render($html,$filename);
}
 

Hide URL From Browser Using Curl Script in Php

First you have to intialise the curl function using ” curl_init()  “.
then set url into curl function like  “curl_setopt($my_curl, CURLOPT_URL, “http://tutjunction.com/”)” . 
then set header false by ” CURLOPT_HEADER “.  
then afer execute the curl and close the curl connection.

Example : 

$my_curl = curl_init();// cURL resource

// WE will add options to our curl
curl_setopt($my_curl, CURLOPT_URL, "http://twitter.com/");
curl_setopt($my_curl, CURLOPT_HEADER, 0);

curl_exec($my_curl); //execute curl function now and display
curl_close($my_curl); // close the curl connection

Create Ms Word File Using Php Script

Here use simple php file function for creating ms word or doc report dynamic.Use following code. Step 1:  

$fp = fopen("Report.doc", 'w+');

The fopen() function is used to open files in PHP.
The first parameter of this function contains the name of the file to be opened and the second parameter specifies in which mode the file should be opened:

Modes Description
r Read only. Starts at the beginning of the file
r+ Read/Write. Starts at the beginning of the file
w Write only. Opens and clears the contents of file; or creates a new file if it doesn’t exist
w+ Read/Write. Opens and clears the contents of file; or creates a new file if it doesn’t exist
a Append. Opens and writes to the end of the file or creates a new file if it doesn’t exist
a+ Read/Append. Preserves file content by writing to the end of the file
x Write only. Creates a new file. Returns FALSE and an error if file already exists
x+ Read/Write. Creates a new file. Returns FALSE and an error if file already exists.

$str="welcome";  
add file content to $str.
fwrite($fp, $str);
fclose($fp); 
write data into file and finally close the file.
Final Code : 
$fp = fopen("reports/Assign_Report.doc", 'w+');
$str ='welcome';
fwrite($fp, $str);
fclose($fp);