Pages

Your Ad Here

This Blog is not to read or go through

because, I have never been such a mess


Search the blog instead

Showing posts with label web programming. Show all posts
Showing posts with label web programming. Show all posts

Monday, June 3, 2013

How To Fix “421 Cleartext Sessions Not Accepted” Error In Filezilla?

Server is enforcing TLS encryption for the connections. Hence, need to add prefix ftpes:// before the hostname of the server

if trying to connection to example.com,
simply change the hostname to ftpes://example.com

Refer to this article for more details if required. 

Sunday, July 3, 2011

Google +1 Button in your site

Implement +1 button to your website

The implementation button is simple. You just need to insert two line of codes to your HTML or theme file.
1. Insert the following javascript code to your  tag
<script type="text/javascript" src="http://apis.google.com/js/plusone.js">script>
2. Insert the following tag to the place where you want the button to appear.
That ‘s it.
For WordPress
As of this post, there are no plugins for adding the +1 button yet (but I am sure it will be available very soon). To add the +1 button, in your themes folder, open the header.php file. Insert the javascript code to the  tag
Open your single.php or index.php, and place the  to the place where you want it to appear.
plus1-button-code

Parameter

There are several parameters that you can use.
Size of the button: The default is “standard“, which is 24px tall. You can choose “small” (15px), “medium” (20px) or “tall” (60px).
Include count: The default is set to “true”. You can turn it off if you don’t want the +1′d count to appear.
URL (href): By default, the button will grab the URL of the existing page, but you can specify your own URL with the parameter href="your-url-here".

http://maketecheasier.com/add-google-1-to-website/2011/06/02
Source: 

Tuesday, May 17, 2011

base_url() function for php



function base_url(){
    $pathinfo = pathinfo($_SERVER["SCRIPT_NAME"]);
    $dirname = $pathinfo["dirname"];
    if($_SERVER["HTTPS"] == "on"){
    $protocol = "https";
    }else{
        $protocol = "http";
    }
    $base_url = $protocol."://".$_SERVER["HTTP_HOST"].$dirname."/";
    return $base_url;
}

Wednesday, July 14, 2010

PHP Jabber Web Chat

Searched a LOT And LOT and finally found one.


PHP/Ajax based Jabber Web Chat Client.


http://blog.jwchat.org/jwchat/

Sunday, May 2, 2010

Understanding CSS Font Stacks

See the presentation on what CSS Font Stack is
http://www.maxdesign.com.au/articles/font-stacks/

And, this is the actual FontStack Builder on Web
http://www.codestyle.org/servlets/FontStack

Friday, April 16, 2010

Automatic Base URL in PHP

# Generate the BASE_URL

$request = $_SERVER["REQUEST_URI"];
$script_path = $_SERVER["SCRIPT_NAME"];
$base_url_len = strlen($script_path) - strlen("index.php");
$arg = explode("/", substr($request, $base_url_len));
$base_url = "http://". $_SERVER["HTTP_HOST"] . substr($script_path, 0, $base_url_len);
define("BASE_URL", $base_url);

author -- acpmasquerade

Thursday, March 18, 2010

PHP array_splice vs. array_slice

Slice
array array_slice ( array $array , int $offset [,int $length [, bool $preserve_keys = false ]] )

Extract a slice of the array

Example :

$input= array("a", "b", "c", "d", "e");

$output = array_slice($input, 2); // returns "c", "d", and "e"
$output = array_slice($input, -2, 1); // returns "d"
$output = array_slice($input, 0, 3); // returns "a", "b", and "c"

// note the differences in the array keys
print_r(array_slice($input, 2, -1));
print_r(array_slice($input, 2, -1, true));





Splice
array array_splice ( array &$input , int $offset [, int $length = 0 [, mixed $replacement ]] )
Remove a portion of the array and replace it with something else

Example :

= array("red", "green", "blue", "yellow");
array_splice($input, 2);
// $input is now array("red", "green")

$input = array("red", "green", "blue", "yellow");
array_splice($input, 1, -1);
// $input is now array("red", "yellow")

$input = array("red", "green", "blue", "yellow");
array_splice($input, 1, count($input), "orange");
// $input is now array("red", "orange")

$input = array("red", "green", "blue", "yellow");
array_splice($input, -1, 1, array("black", "maroon"));
// $input is now array("red", "green",
// "blue", "black", "maroon")

$input = array("red", "green", "blue", "yellow");
array_splice($input, 3, 0, "purple");
// $input is now array("red", "green",
// "blue", "purple", "yellow");



Thanks - PHP.net

Flash Flipping Book HTML Version

The popular Flash Flip Book (page-flip.com) has a good html version to use.

its Joomla component version is used by Nagariknews.com and myrepublica.com

Demo goes here
http://page-flip.com/new-demos/03-kitchen-gorenje-2008/index.html

Pseudo Selectors CSS and JQuery

Pseudo Selectors Primarily for CSS and some for jquery too.
http://css-tricks.com/pseudo-class-selectors/

Wednesday, March 10, 2010

Your Ad Here