Friday, 7 October 2016

PHP sessions


A session is a way to store information to be used across multiple pages.

Session means give a proper time duration for an application, and after that it ends automatically.


We all know that internet don’t know who you are and what application you want to start, when you start application and when you end this application.
Then in that case we use sessions that help server to know about when we end this application. With the help of sessions, we set time duration how many time this application run on server. When session expire, it end the running application on server. It solve the HTTP problem.


session_start() function is used to start a PHP session.

We can start PHP session, for example :

<?php
session_start();
?>

Session variables are set with the PHP Global variable : $_SESSION.





<?php
$_SESSION["favcolor"] = "green";
$_SESSION["favanimal"] = "cat";
echo "Session variables are set.";
?>




Session Modification : We can modify a PHP session variable, to change a session variable or just overwrite it.

$_SESSION["favcolor"] = "yellow";

Destroy a session : To remove a session variable or global variable in session, we can use
session_unset() and session_destroy() function.

Wednesday, 18 May 2016

PHP training in Chandigarh work on frameworks.



Frameworks used in PHP


PHP is a widely used, powerful programming language that allows us to develop massive web applications. Other scripting languages that can be used aside from PHP, are ASP and Ruby. However, PHP is still being implemented the most, and it has no plans of backing down. PHP's popularity is attributed to how easy it is to learn and use, in contrast to other scripting languages.


A PHP Framework is a basic platform that allows us to develop web applications. In other words, it provides structure. By using a PHP Framework, you will end up saving loads of time, stopping the need to produce repetitive code, and you'll be able to build applications rapidly (RAD).
Without a PHP Framework in place, it gets much more difficult to produce applications since you'll have to repeatedly code a lot of PHP. You'll also have to execute the connection between your database and whatever application you develop from scratch. Meanwhile, using a PHP Framework makes it easier for you to ensure this connection.


What to Look for When Choosing Your Frameworks?

When you're searching for a PHP Framework it can get a bit confusing with what you need your framework to do, and with what your framework already comes bundled with. Not every PHP Framework offers the same support for databases, communities, and an easy to follow user guide.

  • Database Support
  • Community Support
  • Documentation Support
  • Model View Controller Architecture