The PCMichiana Tech Help Show
  • Home
  • Free Downloads
  • Video Tutorials
  • Tech Articles
  • Support Forum
  • |
  • Directory
  • Privacy Policy

Click Here To Register For The Forum. It's Completely Free. Check your spam box!

 
Current User: Guest Login Register
Please consider registering


Register? | Lost Your Password?

Search
Search Forums:


 






Minimum search word length is 4 characters – Maximum search word length is 84 characters
Wildcard Usage:
*  matches any number of characters    %  matches exactly one character

Subscribe to PCMichiana:
Follow PCMichiana On RSS Feed Follow PCMichiana On YouTube Follow PCMichiana On Facebook Follow PCMichiana On Twitter Add PCMichiana to Your Favorite Bookmarks

Home Support Forum General Discussion [Tutorial] Learn PHP Part 1

[Tutorial] Learn PHP Part 1

Page:   1   Reply to Post
UserPost

8:35 pm
December 2, 2011


Interoth

Level 6 - Tech Sophomore

posts 47

  Quote and Reply
1

[Tutorial] Learn PHP Part 1

Php is a server side programing language used for making rich web applications.
Wordpress (Including http://pcmichiana.com/) use PHP.

To me, PHP is one of the easiest languages to learn the basics of quickly. Its syntax is easy to remember and simple.

Part 1a – Getting started

To start working with PHP, you will need some simple tools:

A text/code editor – Notepad will work but is VERY bad. Use something such as Notepad++
A webserver – You could buy hosting of a company, or install xamp on your computer. Great tutorial on installing it here.
A web browser – Ironic if you do not know what this is.

I will show you how to use either webservers as we go through this series.

Part1b – Setting up

If you are using xamp, go to your xamp folder (Defualt is C:/xamp/) and go into the htdocs folder. You will be putting all the PHP files in there.

If you have a paid host, just upload the PHP files to your host and open them with a browser. Just copy everything I do in the htdocs folder and upload it to your host.

Right click in the htdocs folder and go to New>File and name it ‘index.php’. When you go to your webserver, it will look for index.php as the homepage.

Open it with your editor and you are ready to go!

Part1c – Hello World!

We will create a simple script that will put the words ‘Hello World’ on the screen as a webpage. Very simple.

PHP is closely tied with HTML, so you can just put HTML around the php code.
To start any PHP file, we put
<?php

and at the end we put a

?>

You can put any HTML you want around those tags.

To print a word onto the screen, we use the print functions. Functions are a command to make the script do. By using the print function, we are telling the script to put something on the page.

The script will look like this:

<?php

print "Hello world!";

?>

To tell the print function to print ‘Hello world!’, we have to put it in speech marks.
The semi-colon at the end tell it that the print function is done.

Saving this as index.php in the htdocs folder of xamp and loading http://localhost/ should make the words ‘Hello world!’ appear. If you get a 404, then PHP is not installed.

That is it for this tutorial, I will continue next time with variables.

        Bow before me for I am /ROOT

10:18 am
December 3, 2011


Craig Chamberlin

Admin

posts 868

  Quote and Reply
2

It's good to see you back Interoth! I owe you an apology for falling all of the face of the earth a few months back. Once my kid was born I got swamped with life. 

Good tutorial guide you have here, might want to be a bit more descriptive and detailed in your titles :) How To Display or Print Text Using PHP – this will increase your chances of getting hit by search engines because people are more likely to type something like that in.

Craig Chamberlin - The PCMichiana Tech Help Show - Founder and Host - http://www.pcmichiana.com

Page:   1   Reply to Post

Reply to Topic:
[Tutorial] Learn PHP Part 1

Guest Name (Required):

Guest Email (Required):

NOTE: New Posts are subject to administrator approval before being displayed

bbCode Editor
Smileys
Confused Cool Cry Embarassed Frown Kiss Laugh Smile Surprised Wink Yell
Post New Reply

Guest URL (required)

Math Required!
What is the sum of:
1 + 1
   

Topic RSS
Search
Subscribe to PCMichiana:
Follow PCMichiana On RSS Feed Follow PCMichiana On YouTube Follow PCMichiana On Facebook Follow PCMichiana On Twitter Add PCMichiana to Your Favorite Bookmarks

About the The PCMichiana Tech Help Show Forum

Forum Timezone: America/Indiana/Indianapolis

Currently Online:
7 Guests

Currently Browsing this Topic:
1 Guest

Recent New Members: hck2cotsonika, Nick, Edwin, mikecats, jaybo2502, Zeldafan1993


© Simple:Press  

 
Join the forum discussion on this post
Be Sociable, Share!
  • Tweet
Site Design by: Press75.com