Check whether request is made from Ajax – PHP

To check whether a request has been made is from Ajax or not you can use $_SERVER[‘HTTP_X_REQUESTED_WITH’]. See the following example: <?phpif(strtolower($_SERVER[‘HTTP_X_REQUESTED_WITH’])==’xmlhttprequest’){ echo “The request is from an Ajax Call”;}else{ echo “The request is not from an Ajax Call”;}?> There you go. You now know how to check whether request made to file is from an Ajax Call or not in PHP.…

Insert XML Data to MySQL Table Using PHP

This tutorial will help you to insert XML file’s contents to a MySQL Database table using php. Note- If you can’t open PHP files in browser in Ubuntu Linux See the Tutorial : http://subinsb.com/how-to-open-php-files-in-ubuntu-instead-of-downloading This is the XML data we are going to insert in to our MySQL Table. <items>  <item>   <title>Google</title>   <url>google.com</url>  </item>  <item>   <title>Google Accounts</title>   <url>accounts.google.com</url>  </item> </items>  The name of the XML file is “items.xml “. MySQL…