[Part 1] Let's Learn PHP

Iamcoolz Feb 16, 2015

  1. Iamcoolz

    Iamcoolz Forum Administrator Staff Member XPG Administrator
    135/188

    Joined:
    Mar 30, 2012
    Messages:
    1,227
    Likes Received:
    507
    Trophy Points:
    205
    Gender:
    Male
    Location:
    XPG
    Console:
    Xbox One
    This will be a several part series, I will cover the following topics in no particular order at all! I will try and post a different one each day, but that's only if my schedule allows it. This will teach you the basics, and even more on PHP.

    Topics:
    • Introduction
    • Syntax
    • Environment
    • Arrays
    • Strings
    • Web Concepts
    • Loop Types
    • Operator Types
    • Sessions
    • Cookies
    • Functions
    • GET & POST
    • Coding Standards
    • Decision Making
    • Constants
    • Variable Types

    These will all be covered, we will firstly go into the introduction.

    Introduction to PHP

    PHP was created as any other project was created, it was created by a person who created an open source project and as time progressed, this particular language exploded when people found out how useful it actually is. PHP stands for Hypertext Preprocessor. PHP is a language that is embedded or put inside of HTML, this allows users to manage databases, session's, dynamic pages, and several other things. Lucky enough, if you know C, the syntax for PHP is almost the exact same!

    There is an acronym you are taught when going to college for web development, and acronym that explains the main characteristics of PHP.

    • Simplicity
    • Efficiency
    • Security
    • Flexibility
    • Familiarity

    PHP is used very commonly, and in-fact this forum itself is built upon PHP, thus logging in, registering, post count, your data, all saved in a database that PHP pulls when needed. PHP is used by major security companies as it can encrypt data, this makes it extremely hard for hackers to get your password from a database.

    Enough with the PHP, let's look at some ways you, yourself, can code your very first script. We will do the most simplistic PHP script you can do. As stated above, PHP is embedded in HTML, thus you will see HTML tags involved when it comes to register forms and so on.

    <html>
    <head>
    <title>Welcome to XPG: PHP</title>
    <body>
    <?php echo 'Hello there XPG! I created my first PHP script';?>
    </body>
    </html>
    So, let's break this down a bit.

    <html> tags are put there to let the web server know to read it in the HTML mark-up language.
    <title> this is the text that is put at the top of your screen in the tab section!
    <body> this is just defining the documents body and what's in it.
    <?php echo;?> this tells the PHP program to echo or say what is wrote between the ' ' or " ".

    This is the introduction and as you can tell, if you know HTML, PHP will come to you a lot easier, if you know C, PHP will come to you like a fat kid comes to cake.

    -Iamcoolz
     
  2. OfficialSilas

    OfficialSilas The PC Wizard
    105/188

    Joined:
    Jan 11, 2014
    Messages:
    1,578
    Likes Received:
    507
    Trophy Points:
    105
    Gender:
    Male
    Location:
    Australia
    Console:
    Other
    Please pin this bro! This is helpful as heck! Could I PM you if I need assistance for my DreamWeaver site bro?? And again, thanks for this!
     
  3. reloadmydeagle

    reloadmydeagle I LoVe GoldZ Lifetime Gold XPG Retired Staff
    135/188

    Joined:
    Oct 30, 2013
    Messages:
    1,608
    Likes Received:
    656
    Trophy Points:
    135
    Gender:
    Male
    Location:
    Texas
    Console:
    Xbox One
    Glad you're doing this, as I don't know PHP at all. Good job.
     
  4. Iamcoolz

    Iamcoolz Forum Administrator Staff Member XPG Administrator
    205/282

    Joined:
    Mar 30, 2012
    Messages:
    1,227
    Likes Received:
    507
    Trophy Points:
    205
    Gender:
    Male
    Location:
    XPG
    Console:
    Xbox One
    Feel free Sillas!
     

Share This Page

Close