How to install laravel in localhost (xampp)

To Install Laravel In your LocalHost(windows) is Very Eazy. Please Follow the Steps:

1. Download xampp and install it.
2. Download and install Composer from https://getcomposer.org/download(for windows)
3. Make sure you have internet connection

Note: Please make sure php_openssl is enabled in your php.in file for installing composer

Now go to your localhost htdocs folder(for xampp) C:/xampp/htdocs
htdocs
Click on Use composer here.
Then you see a command window like
use
Type: composer create-project laravel/laravel
Press enter then it starts downloading laravel files from server….
2
After completed downloading when it shows your laravel application key.

Now open your browser and Type http://localhost/laravel/public/
welcome
Finished, Thank You

Create your first application in Xampp using Yii framework.

Following below steps, you can create your first yii application.
Step 1: Download Latest version of Yii from http://www.yiiframework.com/
Step 2: Extract it in your web server root directory and rename it to yii. For example if you are use xampp(located in D drive) in local server then it will be D:xampp/htdocs/yii folder.
Step 3: Now open your command window.
Step 4: Looks like,C:\Users\helal> (then type as like following)
Step 5: C:\Users\helal>d:
Step 6: D:\>cd xampp
step 7: D:\xampp>cd php
Step 8: D:\xampp\php>php.exe D:\xampp\htdocs\yii\framework\yiic webapp D:\xampp\htdocs\demo
Step 9: Create a Web application under ‘D:\xampp\htdocs\demo’? [yes: no]
Step 10: Type yes and press Enter.

Your application has been successfully created under D:\xampp\htdocs\demo
Thanks

PHP Framework Which One You Should Use?

Use codeigniter if :
ci
1. you don’t like command line.
2. you are beginner or intermediate in PHP.
3. you hate long list of files which are predefined and want to write more code of yours.
4. you want to learn a php framework quickly

Use Cake php if :
cake-logo
1. if you love command line
2. CakePHP’s ‘Bake Console’ can create any of CakePHP’s basic ingredients: Models, Controllers, Views. It can basically create a fully functional application in minutes.
Use Yii if :
yii
1. you are expert in php.
2. you love to use predefined code (libraries).
3. don’t like to write basic code for database.
4. It is little bit faster than CI and Zend.

Use zend if:
zf
1. you you like integrated development environment(provided by Zend studio which is paid)
2. It’s a powerfull PHP Framework which is more secure, reliable and allow Web 2.0 applications & web services.
3. It is used in building big applications.

What is difference between get and post method ?

There are two different ways that a form can be submitted from your browser to the webserver.
1. GET method
2. POST method
For example,
<form method=”get” action=” “> </form>
<form method=”post” action=” “></form>
When form is submitted,a HTTP request occured that passes data to webserver. HTTP request is which your web browser uses to communicate with web server.HTTP request generation depends on which type of method used in submitting form.

GET method:
If a GET request is used, the form parameters are encoded in the URL in what is called a query string.
For example,www.shobarjonno.com/?user=admin&password=@dmin123
Your form parameters are included in end of URL.

POST method:
A POST request, unlike a GET request, passes the form parameters in the body of the HTTP request, not in the URL.
It happens behind the scene between web browser and web server.

Difference between include(),include_once() and require(), require_once() in php.

include(), require() both read in the target file.require() will show a Php fatal error if the file cannot be loaded.
include() shows a warning if the file cannot be loaded.

Only difference between include_once() and include() is that if the code from a file has already been included, it will not be included again.

For example,
If you have 3 files named: menu.php,header.php,content.php.
menu.php:
<?php
function createMenu()
{
echo ‘ ‘;
}
?>

header.php:
<?php
include(‘menu.php’);
?>

content.php:
<?php
include(‘menu.php’);
include(‘header.php’);
?>

If you open content.php,you get a error because you already include menu.php into header.php. You will get an error saying that function createMenu() was already declared in header.php which means I have included menu.php two times.

To be sure I only include menu.php only one time, I should use the include_once() function, so my content.php should look like this:

content.php:
<?php
include_once(‘menu.php’);
include(‘header.php’);
?>

Same on require() and require_once().

How to replace white space from a string with underscore and joined together in jquery?

<script>
$(‘#title’).change(function(){
var string= $(‘#title’).val().toLowerCase();
var temp=string.split(” “);
var string = temp.join(“_”);
$(“#link”).val(string);
});
</script>

html:
<input name=”title” id=”title”>
<input name=”link” id=”link”>

Result:
You enter in first input: My first blog
Second input will be: my_first_blog