INTRODUCTION TO PHP
       by Jorge Garifuna
     info@GariDigital.com
           @jgarifuna
       jgari.com/resume




              1
WHAT IS PHP?


Recursive acronym for PHP: Hypertext Preprocessor

Widely-used open source general-purpose scripting
language

Suited for web development and can be embedded
into HTML




                        2
WHEN TO USE PHP




       3
WHY USE PHP



It integrates with everything

Best documentation on the web

It makes you a Power Hungry Programmer!




                         4
WHY USE PHP




     5
PROJECTS USING PHP




        6
WAYS TO LEARN PHP

1. By writing straight PHP from scratch

2. By using PHP frameworks

  CakePHP

  Symfony

  Zend

3. By using Quick Web Application Builder (QWAB)


                         7
SETTING UP
             ENVIRONMENT
Mac OS (ready or MAMP or )
  http://www.coolestguyplanettech.com/how-to-install-php-mysql-apache-on-os-x-10-6/


Windows (XAMPP or WAMP)
  http://www.apachefriends.org/en/xampp.html


Linux
  Ubuntu: sudo apt-get install php5 mysql-server apache2

  CentOS: http://www.howtoforge.com/quick-n-easy-lamp-server-centos-rhel




                                           8
TOOLS

Text Editor or IDE
  PSPad
  netbeans
  eclipse
Database administration
  phpMyAdmin
  Sequel Pro
  MySQL Workbench

                          9
FIRST PHP PROGRAM

<?php
   echo "Hi, I'm a PHP script!";
?>


  Save as hello.php on web server




                          10
CONNECTING TO
          DATABASE

<?php
if (mysql_connect(DB_SERVER, DB_USER, DB_PASSWORD)){
       if (mysql_select_db(DB_NAME)){
          return true;
       }
}

die("nDB ERROR: " . mysql_error() . "n");
?>Text




                                  11
PROCESSING FORMS
file name: myform.html

<html>                                                  file name: myform.php
<body>
     <form action="myform.php" method="post">           <html>
                                                        <body>
         <p>Your Name:                                       Your name is:
         <input type="text" name="yourname" /><br />
                                                            <?php echo $_POST['yourname']; ?><br />
         E-mail:
         <input type="text" name="email" /></p>             Your e-mail:
         <p>Do you like this website?                       <?php echo $_POST['email']; ?><br />
         <input type="radio" name="likeit"                  <br />
         value="Yes" checked="checked" /> Yes
         <input type="radio" name="likeit"                  Do you like this website?
         value="No" /> No
         <input type="radio" name="likeit" value="Not       <?php echo $_POST['likeit']; ?><br />
         sure" /> Not sure</p>                              <br />
         <p>Your comments:<br />                            Comments:<br />
         <textarea name="comments" rows="10"
         cols="40"></textarea></p>                          <?php echo $_POST['comments']; ?>
         <p><input type="submit" value="Send it!"></    </body>
         p>                                             </html>
     </form>
</body>
</html>




                                                   12
CONNECTING TO FACEBOOK
   AND TWITTER WITH
     HYBRIDAUTH




http://oyanix.com/opensource/hybridauth/




                     13
SPEEDING UP PROTOTYPING WITH
  QUICK WEB APPLICATION
     BUILDER (QWAB)


Generates complete functional web-based
applications through a web-based interface in three
easy steps

Would you like to see it in action?

http://garisoft.com/qwab




                          14
HOSTING RESOURCES
      FOR PHP


hostmonster.com

hostgator.com

godaddy.com




                  15
TRANSFERRING YOUR PHP
   FILES TO THE SERVER




http://filezilla-project.org/




                         16
USEFUL PHP RESOURCES

http://www.phpclasses.org/

http://php.net/

http://framework.zend.com/

http://cakephp.org/

http://www.laphp.org/

http://lampsig.org

http://www.meetup.com/LAMPsig/

                        17
SEREMEIN!(THANK YOU!)


            Jorge Garifuna
        info@GariDigital.com
              @jgarifuna
          jgari.com/resume


   http://www.meetup.com/LAMPsig



                 18

Introduction to php