Posts

Showing posts with the label PHP

Fixed: "Your PHP Installation Appears to be Missing the MySQL Extension which is Required by WordPress."

Image
While installing or running a WordPress website you may hit the server side error "Your PHP Installation Appears to Be Missing the MySQL Extension Which Is Required by WordPress.". The error generally appears due to outdated PHP version, non-existing MySQL extension on your hosting server or outdated WordPress version. We will see the causes behind the server side error "Your PHP Installation Appears to Be Missing the MySQL Extension Which Is Required by WordPress." and understand how to solve this with few easy steps. How to fix: Your PHP Installation Appears to Be Missing the MySQL Extension Which Is Required by WordPress. Why the server side error "Your PHP Installation Appears to Be Missing the MySQL Extension Which Is Required by WordPress." surfaces? When you make a WordPress install on server or localhost using XAMPP/WAMPP there can be a mismatch among the PHP version required by the WordPress version that you have installed on top of it. Ther...

Cannot Modify Header Information - Headers Already Sent : How To Fix

This error message gets triggered when anything is sent before you send HTTP headers (with setcookie or header). Common reasons for outputting something before the HTTP headers are: 1. Accidental whitespace, often at the beginning or end of files, like this: the space before "php opening tag" To avoid this, simply leave out the closing ?> - it's not required anyways. 2. " Byte order marks " at the beginning of a php file. Examine your php files with a hex editor to find out whether that's the case. They should start with the bytes 3F 3C. You can safely remove the BOM EF BB BF from the start of files. 3. Explicit output, such as calls to echo, printf, readfile, passthru, code before php opening tag etc. 4. A warning outputted by php, if the display_errors php.ini property is set. Instead of crashing on a programmer mistake, php silently fixes the error and emits a warning. While you can modify the display_errors or error_reporting configurations...

Geolocation by area/city name

Image
Hi its again about the Geo-location , but its inverse Geo-location   actually I was googling for a question: how to get lat long by city name ?  OR  how to get lat long by address ? and got this one working and simply awesome  :  http://ws.geonames.org/search?name=ujjain&country=in&type=xml Add caption This will return you XML  that will contain lat- long for that are with some other city related information. you just have to extract the lat- long from this xml. be lazy... be awesome :)

Geolocation using ip address

Image
Here is a method for C-sharp lovers, It will fetch the IP Address of Client and some other browser info of the host when you run it after compiling your code. We are just creating Http Request and an object of HttpBrowserCapabilities class. Now with this object we can collect all the host specific data that we will send to service to get the Geolocation of the host. private string UserLogEntry(string flag) { String publicIpAddress = HttpContext.Current.Request.UserHostAddress.ToString(); HttpBrowserCapabilities oBrowserCap = Request.Browser; String browserName = oBrowserCap.Browser.ToString(); String version = oBrowserCap.Version.ToString(); String majorVersion =oBrowserCap.MajorVersion.ToString(); String minorVersion =oBrowserCap.MinorVersion.ToString(); String platform = oBrowserCap.Platform.ToString(); String isBeta = oBrowserCap.Beta.ToString(); String isCrawler =oBrowserCap.Crawler.ToString(); ...

Fetching an URL :

Just make a variable as given below and that's it. $our_url ='http'.((!empty($_SERVER['HTTPS']))?'s':'').'://'.$_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF'];