Showing posts with label local machine. Show all posts
Showing posts with label local machine. Show all posts

Monday, 10 February 2014

Phpinfo function


phpinfo function
Phpinfo Function
The phpinfo function. We should detailed look to php installation so for example you may go later to look at GD library. Its a Image generate Images using its command-set its addition to php may not be included in original php installation. If some one ask you did you had kernel or GD images installed. You should know what its is its a Different library for php. You need to find a way to check every think in php installation and general information about php version some one must ask you or need to find out which version of php you using and different features of php version works with updated php version. Different features of php works with different versions of php. You must using older version of php and could not get some advantages of php updated features. so should check updated version. This stuff you can find out by phpinfo() function.So to call function its relatively simple Within php tags write phpinfo(); () Its a standard notation for calling function. Its a built-in function of php which is built ed in directory ofinstallations files.

Codes To Write phpinfo function :-


Code Phpinfo Function
Code PhpInfo Function
<?php
phpinfo();
?>

Output For Phpinfo Function

Phpinfo function
Output PhpInfo function Php



We can see php version 5.2.9 in output as you scroll down you will see many things enabled and all. Its a list of collection of our php installation  its having information about php core, apache , apache environmental  ftp support and many other stuff. Also gd libaray gd version and its also linked in apache. One thing you should always remember this file should not be upload on your server its available on your local machine. If you upload this file on server had change to hack your website. phpinfo file had lots of information about out php installation on our local machine from that data anyone can harm your files. If you had such file on server should delete it for security purpose.So phpinfo had an information about your php package.
Read More

Sunday, 9 February 2014

Creating Your First Php File

Creating Your First Php File
My First Php
This is a tutorial for creating our first in php file. We installed Xampp for Windows so, Now we are at the stage Xampp is running well and phpmyadmin works so we can work on database system in our local machine. We see our Xampp control panel apache and MySQL starts and stops in the services. In this services we focus on apache and MySQL which we use most frequently.

This tutorial is based on how to create your first file of php and also see its output. We will see phpinfo function in this and hope you can find great info in that ok. So go head and we need open up folder shown in Screenshot, its Xampp folder in C:\ drive C:\xampp by default its install xampp in c drive and it also depends in which drive you had setup your Xampp depends upon you by default its in c:\ drive. In Xampp folder you can see many folders, in that php folder installation folder where you can see all dll files php.ini files. Later in this tutorial, i will show you details about php.ini.


localhost
C:\xampp
htdocs is the folder i want you to focus as you can in Screenshot because we are creating our first php file which will be in this folder. Now let open browser you know now we are running our php files locally on our local machine so in browser we don’t need to write localhost\htdocs\ourfile.php because htdocs is our root directory where our file should be now lets go to htdocs folder and create file myfirstfile.php. Remember, when you create file your extension must be .php.

htdocs
htdocs
There are many text-editor depends on you which one you want to use. Text-editor such as notepad is the best example. I am using conTEXT, you can use notepad++ also. Now opening conTEXT, creating file and i will save it save as root as C:\xampp\htdocsdefault path for saving file and running it on local machine. So creating myfirstfile.php, now you can see local machine in browser open localhost/myfirstfile.php shown in screenshot3. We had only written data in file and it shows in the browser. In this way, we can access our files on browser by help of Xampp root directory.

myfirstfile.php
MyFirstFile.php
In screenshot 4, it is ConTEXT text editor software. Screenshot 5 shows in file>save as will save file name myfirstfile.php. .php is extension of php file will run that file on Xampp localhost on our webserver.

notepad++
Screenshot4
Files
Screenshot5
When i click save its automatically index highlighting. Index highlighting is it highlight php codes such as construction , string , variables, etc. This is the reason why i am using ConTEXT as my text editor. You can see in screenshot6 index highlighting is on. You can also modify index highlighting from option in ConTEXT software.

php Code
Screenshot6
Now see in browser our file localhost/myfirstfile.php, we press enter and this file will loaded in browser. Because its php file you should write html tags in it. Now simply, we write DATA in our php file and you can see in screenshot3 it shows in browser.
So in this way you can create folder directory root in it. So for creating our first file we had done this now our php file tags displayed in screenshot 8.

<?php
<?php ?>
<?php

?>
Its just similar  to how we write  html Codes.

<html>



</html


Read More

About Me

Welcome to Extra Tutorials! My name is Mohammed and I am the 22 year writer, website developer, and photographer behind the blog. Thanks for visiting! Tutorials Jackpot… In addition to Developer, I love to develop websites and I love to write. Starting a php Blog was inevitable for me. What began as a simple way to share all of my Tutorials with friends and family has developed into my Part time job.

Mohammed Padela

WHAT IS PHP PROGRAMMING

WHAT IS PHP PROGRAMMING
WHAT IS PHP PROGRAMMING

Follow Us

Popular Posts

Designed ByBlogger Templates