PHP With MySQL For Beginners Day 1

Leave a Comment

What is php?


PHP is a server scripting language. Now you may have thought that PHP was a programming language. Well, technically speaking, it's not. So how's a scripting language different from a programming language? A script only runs in response to an event. It also usually runs a set of instructions by working down the page from the start to the end. It has little or no user interaction after that initial event. So PHP script does not run until a web page is requested. Then it launches, follows its instructions from top to bottom, and then quits until another action launches the script again. On the other hand, a program, runs even when not responding to events. It continues to run, and to wait for interaction.


History of PHP


Php Version 1 was written by Rasmus Lerdorf in 1994.Version 2 was a more formalized version that he put out in 1995. But in version 3, PHP changed dramatically. Two other developers got involved, Zeev Suraski and Andi Gutmans. These two developers rewrote major parts of PHP between 1997 and 1998. they also renamed it PHP hypertext preprocessor. Now you can see that in those three words we still have the initials P, H and P, but the first word in the acronymn is the acronym itself.After that Php 4 is responsible for making PHP incredibly popular. PHP 5 includes a lot of new features, such as better performance, improved object oriented programming and some better database connectivity.

Why we have choose PHP?


First of all php is my fav scripting language. There are many reasons to use PHP. This first is obviously that you've discovered the limits of HTML and now you need something more. Php is open source. Open source means the source code is available for all to study , to modify or to user.
And its free software so its free to download and free to user there is nothing purchase or no licensing fees. I want to tell you one more thing php also cross platform to develop and deploy. So its means you can php any where on windows , linux or mac server. I think its enough of convince why we have to use php. Facebook is in php. I think you have to watch this The Social Network Movie. This is my one of favorite movie this movie inspire to learn php
I hope after all this thing. you're excited to get started. So lets check what we need to run php.

1) Web Server
2) Database Server
3) Text Editor
4) Browser

For Web Server we don't need to buy domain or any server. We can run php on our local machine we have to just download few software which are free no need to by license.
Those combinations we refer to as The Stack. And the different stacks that are most popular are referred to as LAMP, MAMP, WAMP, and XAMPP. For LAMP, it's LAMP, which stands for Linux, Apache, MySQL, and PHP. And then for the M, it stands for Macintosh, the W in WAMP is for Windows, and the X is for all three of those.
I am using windows so i will go for XAMPP as a server and sublime as text editor.Download XAMP From here. After download just double click and click on next you php and phpmyadmin will automatically install.

Now that we have PHP installed. Were ready to start learning how to use it. So let's start with our first php program. Open your text editor copy paste this below code
<?php echo "Hello Php now i started work on you"; ?>

Save this file as Hello.php I am using windows with xampp so my root directory is C:\xampp\htdocs. Under htdocs i created Php and inside that day1 folder to save my file you can see in image



After writing your php program we have run this file in browser so for that localhost/filename.php. If you have file inside folder then localhost/foldername/filename.php. To run my file http://localhost/Php/Day1/Hello.php i will run like this.
If its give this kind of page



Its means you did't start your Xampp server so start your xampp server



Again hit the url then you are go Congratulations your first php code is run



So, guy's that it for the day1. For day2 we will start with combination of html and php and declare php variable and more cool things

Guy's if you like this please comment below or share this page with you frnds. If you any problem or question please ask to me on comment

Deploy app on heroku

Leave a Comment

Deploying your first app on heroku

Follow this steps to deploying your first app on heroku

Step 1

Creating account on heroku

step 1

Step 2

Confirm your account

step 2
After confirming your you will get screen to change your password

Step 3

Change you password

step 3


After that you will get welcome screen

step 4


Click on proceed you will get this screen

step 5


Step 4

Click on plus sign on right side of browser screen

step 6


After click on create app you will get this screen

step 7


Step 5

Download Heroku Toolbit & install heroku toolbit

step 8


step 9


Step 6

Go to your app which you have to deploy on heroku. Click mouse right side click you will get this menu. After click on git bash

step 10


step 11


Step 7

Create a new Git repository
Type some command to Initialize a git repository in a new or existing directory
$ git init
$ heroku login


login with your heroku credentials After that type

$ git remote -v
if your get any remote connection then remove that connection and add new remote connection

$ heroku git:remote -a name_of_your_app
you will get success message. After that again run $ git remote -v

step 12


Step 8

Deploy your application
After to all this step your app is setup. Now Commit your code to the repository and deploy it to Heroku using Git.
$ git add 
$ git commit -am "write your comment"
$ git push heroku master


step 13

CodeIgniter From Scratch: Day 1

Leave a Comment

CodeIgniter From Scratch: Day 1

Over the course of about 10 videos, Jeffrey Way will teach you exactly how to use this framework. Ultimately, we'll work our way up to building a custom CMS. Without further ado, here's day one!


Powered by Blogger.