web stats analysis

Archive for August 8th, 2013

What is session variable in php?

How to create session in php?

What is the use of session?

How to use session in php?

Description about session is bellow:

A PHP session is also One type of variable..
Which is used to store information.
Session variables Store the information about single user, And In the one Application all pages are available.

PHP session variable

Always we working with any application,
We just open it,do something work and closed it.
computer knows evrything what you do.
But server has a oine problem.
It’s don’t know actually what yoiu do? It’s doesn’t metter.
That’s why server need session.

sessions work by creating a unique id for each visitor and store variables based on this uniqe id.
The UID is stored in a cookie or either is propagated in the URL..

How to start php session?

Note: The session_start() function must appear before the tag:


<?php session_start(); ?>

<html>
<body>

</body>
</html>

How to store session variable?



<?php
session_start();
// store session data
$_SESSION['views']=1;
?>

<html>
<body>

<?php
//retrieve session data
echo "Pageviews=". $_SESSION['views'];
?>

</body>

Below example, we create a simple page-views counter.
The isset() function checks if the “views” variable has already been set.

<?php session_start(); if(isset($_SESSION['views'])) $_SESSION['views']=$_SESSION['views']+1; else $_SESSION['views']=1; echo "Views=". $_SESSION['views']; ?>

How to Destroying a Session?

When you want to delete some session data, you can use the unset() or the session_destroy() function.

The unset() function is used to free the specified session variable:



<?php
session_start();
if(isset($_SESSION['views']))
unset($_SESSION['views']);
?>

If you want to completly destroy the session So, you can
By calling session_destroy() function:



<?php
session_destroy();
?>

How to redirect to another page after click on facebook like button?

How to redirect to another page after click on facebook like button?

Redirect after a user clicked a facebook like button

How to redirect to another page after click on facebook like button?

Write the following script between head tag.


<script type="text/javascript">

window.fbAsyncInit = function () {
FB.init({
appId: 'Your facebook application Id',
status: true,
cookie: true,
xfbml: true,
oauth: true
});
FB.Event.subscribe('edge.create', function (response) {
window.location = "http://code.top10idea.com";
});
};
(function (d) {
var js, id = 'facebook-jssdk';
if (d.getElementById(id)) {
return;
}
js = d.createElement('script');
js.id = id;
js.async = true;
js.src = "//connect.facebook.net/en_US/all.js";
d.getElementsByTagName('head')[0].appendChild(js);
} (document));

</script>

And Write the following code between body tag.



<div id="fb-root">
</div>
<div>

<div data-href="http://www.facebook.com/offerfair" data-width="300px"
data-show-faces="true" data-stream="false" data-header="false">
</div>
</div>

How to solve probably tried to upload too large file. Please refer to documentation for ways to workaround this limit.

Solved:You probably tried to upload too large file.
Please refer to documentation for ways to workaround this limit:

Follow by bellow Solution.

• create .htaccess file in C:\wamp\apps\phpmyadmin 3.5.1 And copy the following code
into the .htaccess

• php_value upload_max_filesize 120M

• php_value post_max_size 120M

• php_value max_execution_time 200

• php_value max_input_time 200

How to solve You probably tried to upload too large file.
Please refer to documentation for ways to workaround this limit..

How to add Dynamic menu using css3?

How to insert Dynamic menu using Css3?

Which Css is use to create Dynamic menu?

Using Css3we can create Dynamic menu

  • Follow the bellow Css3.
  • Create Dynamic menu using css3.

    
    nav {
    /* Repeating background image */
    background-color:#666;
    width:180px;
    
    }
    
    nav ul {
    /* Removes bullet points */
    list-style:none;
    margin:0;
    padding:0;
    
    }
    nav ul li {
    /* Any child positioned absolutely will be positioned relative to this */
    position:relative;
    border-bottom:solid 1px #818181;
    }
    nav a {
    color:#CCC;
    padding:12px 0px;
    /* Fill all available horizontal space */
    display:block;
    /* Remove underline */
    text-decoration:none;
    /*
    New CSS3 animations:
    apply transition to background property, taking 1s to change it
    */
    transition:background 1s;
    -moz-transition:background 1s;
    -webkit-transition:background 1s;
    -o-transition:background 1s;
    font-family:tahoma;
    font-size:13px;
    text-transform:none;
    padding-left:20px;
    }
    nav a:hover {
    /*
    RGBA background for transparancy:
    last number(0.05) is the transparency
    */
    background-color:#C60;
    color:#fff;
    
    }
    nav a:hover span {
    background:#FFF;
    transform:rotate(90deg);
    -moz-transform:rotate(90deg);
    -webkit-transform:rotate(90deg);
    }
    nav ul li:hover ul {
    display:block;
    }
    nav ul ul {
    position:absolute;
    left:180px;
    top:0;
    border-top:1px solid #e9e9e9;
    display:none;
    }
    nav ul ul li {
    width:180px;
    background:#f1f1f1;
    border:1px solid #e9e9e9;
    border-top:0;
    border-bottom:solid 1px #CCC;
    }
    nav ul ul li a {
    color:#a8a8a8;
    font-size:12px;
    text-transform:none;
    }
    nav ul ul li a:hover {
    color:#FFF;
    }
    nav span {
    width:12px;
    height:12px;
    background:#fff;
    display:inline-block;
    float:left;
    margin-top:3px;
    margin-right:20px;
    position:relative;
    transition:all 0.5s;
    -moz-transition:all 0.5s;
    -o-transition:all 0.5s;
    -webkit-transition:all 0.5s;
    }
    nav span:before {
    content:"";
    width:12px;
    height:2px;
    background:#3a3b3b;
    position:absolute;
    left:0px;
    top:5px;
    }
    nav span:after {
    content:"";
    width:2px;
    height:12px;
    background:#3a3b3b;
    position:absolute;
    left:5px;
    position:top;
    }
    

How to declare HTML elements?

How to define HTML element?
What is HTML elements?
How to write HTML elements?
In HTML element we can write everything inside the start tag and end tag.

Syntex of HTML elements:
• HTML element must start with a start tag.• HTML element must end with an end tag.

• In HTML element we can write everything inside the start tag and end tag.

• HTML elements also have empty content.

• Every Empty elements are ended in the start tag.

• Most of HTML elements have attributes

Opening Tag Element content Closing Tag
 <a href=”index.htm”> contain Link. </a>
 <p> Contain paragraph. </p>
<br> Conatin break the line.
What is HTML elements,Explain HTML elements
HTML elements.