Wednesday, 29 July 2015

how-fix-wampserver-if-localhost-not-working

http://www.learn-drupal.com/content/how-fix-wampserver-if-localhost-not-working

Saturday, 11 April 2015

Variable Types

  • settype() - Set the type of a variable
  • get_class() - Returns the name of the class of an object
  • is_array() - Finds whether a variable is an array
  • is_bool() - Finds out whether a variable is a boolean
  • is_callable() - Verify that the contents of a variable can be called as a function
  • is_float() - Finds whether the type of a variable is float
  • is_int() - Find whether the type of a variable is integer
  • is_null() - Finds whether a variable is NULL
  • is_numeric() - Finds whether a variable is a number or a numeric string
  • is_object() - Finds whether a variable is an object
  • is_resource() - Finds whether a variable is a resource
  • is_scalar() - Finds whether a variable is a scalar
  • is_string() - Find whether the type of a variable is string
  • function_exists() - Return TRUE if the given function has been defined
  • method_exists() - Checks if the class method exists

Tuesday, 7 April 2015

Browser and OS env details

<?php
echo "Login Page<br>";
$viewer = getenv( "HTTP_USER_AGENT" );
   $browser = "An unidentified browser";
   if( preg_match( "/MSIE/i", "$viewer" ) )
   {
      $browser = "Internet Explorer";
   }
   else if(  preg_match( "/Netscape/i", "$viewer" ) )
   {
      $browser = "Netscape";
   }
   else if(  preg_match( "/Mozilla/i", "$viewer" ) )
   {
      $browser = "Mozilla";
   }
   $platform = "An unidentified OS!";
   if( preg_match( "/Windows/i", "$viewer" ) )
   {
      $platform = "Windows!";
   }
   else if ( preg_match( "/Linux/i", "$viewer" ) )
   {
      $platform = "Linux!";
   }
   echo("You are using: $browser on $platform");
?>

O/P:
You are using: Mozilla on Windows!

Amazing PHP Site with awesome examples - http://www.homeandlearn.co.uk/php/php.html

http://www.homeandlearn.co.uk/php/php.html

Thursday, 2 April 2015

Install WAMP and then execute first script




First one:

index.php

<?php
echo "HelloWorld";
?>
<!DOCTYPE html>
<html>
<body>
  <button type="button" href="'window.location="login.php"'">Click Me!</button>
</body>

</html>

http://www.wampserver.com/en/

http://www.wampserver.com/en/