Introduction to php

1,549 views

Published on

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Introduction to php

  1. 1. INTRODUCTION TO PHP by Jorge Garifuna info@GariDigital.com @jgarifuna jgari.com/resume 1
  2. 2. WHAT IS PHP?Recursive acronym for PHP: Hypertext PreprocessorWidely-used open source general-purpose scriptinglanguageSuited for web development and can be embeddedinto HTML 2
  3. 3. WHEN TO USE PHP 3
  4. 4. WHY USE PHPIt integrates with everythingBest documentation on the webIt makes you a Power Hungry Programmer! 4
  5. 5. WHY USE PHP 5
  6. 6. PROJECTS USING PHP 6
  7. 7. WAYS TO LEARN PHP1. By writing straight PHP from scratch2. By using PHP frameworks CakePHP Symfony Zend3. By using Quick Web Application Builder (QWAB) 7
  8. 8. SETTING UP ENVIRONMENTMac 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.htmlLinux Ubuntu: sudo apt-get install php5 mysql-server apache2 CentOS: http://www.howtoforge.com/quick-n-easy-lamp-server-centos-rhel 8
  9. 9. TOOLSText Editor or IDE PSPad netbeans eclipseDatabase administration phpMyAdmin Sequel Pro MySQL Workbench 9
  10. 10. FIRST PHP PROGRAM<?php echo "Hi, Im a PHP script!";?> Save as hello.php on web server 10
  11. 11. CONNECTING TO DATABASE<?phpif (mysql_connect(DB_SERVER, DB_USER, DB_PASSWORD)){ if (mysql_select_db(DB_NAME)){ return true; }}die("nDB ERROR: " . mysql_error() . "n");?>Text 11
  12. 12. PROCESSING FORMSfile 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
  13. 13. CONNECTING TO FACEBOOK AND TWITTER WITH HYBRIDAUTHhttp://oyanix.com/opensource/hybridauth/ 13
  14. 14. SPEEDING UP PROTOTYPING WITH QUICK WEB APPLICATION BUILDER (QWAB)Generates complete functional web-basedapplications through a web-based interface in threeeasy stepsWould you like to see it in action?http://garisoft.com/qwab 14
  15. 15. HOSTING RESOURCES FOR PHPhostmonster.comhostgator.comgodaddy.com 15
  16. 16. TRANSFERRING YOUR PHP FILES TO THE SERVERhttp://filezilla-project.org/ 16
  17. 17. USEFUL PHP RESOURCEShttp://www.phpclasses.org/http://php.net/http://framework.zend.com/http://cakephp.org/http://www.laphp.org/http://lampsig.orghttp://www.meetup.com/LAMPsig/ 17
  18. 18. SEREMEIN!(THANK YOU!) Jorge Garifuna info@GariDigital.com @jgarifuna jgari.com/resume http://www.meetup.com/LAMPsig 18

×