php for beginners'

871 views

Published on

Published in: Education
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
871
On SlideShare
0
From Embeds
0
Number of Embeds
5
Actions
Shares
0
Downloads
67
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

php for beginners'

  1. 1. BY KANIKA SINGHAL 3 RD YEAR COMPUTER ENGINEERING College of Technology, GBPUA&T 06/07/09 04:12 PM
  2. 2. <ul><li>What is PHP </li></ul><ul><li>Basics of PHP </li></ul><ul><li>Writing simple programs in PHP </li></ul><ul><li>Why use PHP </li></ul><ul><li>More on PHP programming </li></ul><ul><li>Retrieving data from the client </li></ul><ul><li>Designing forms </li></ul>06/07/09 04:12 PM
  3. 3. 06/07/09 04:12 PM
  4. 4. 06/07/09 04:12 PM
  5. 5. 06/07/09 04:12 PM
  6. 6. <ul><li>Hands on experience……… </li></ul>06/07/09 04:12 PM
  7. 7. <ul><li>BASIC CODE IN TEXT EDITOR </li></ul><ul><li>HOW IT LOOKS ON WEB BROWSER </li></ul>06/07/09 04:12 PM Example 1
  8. 8. 06/07/09 04:12 PM
  9. 9. 06/07/09 04:12 PM Web server locates instructions file Web server processes instructions to create HTML HTML stream returned to browser Browser processes HTML and displays page Client requests webpage Author writes instructions Delivering a web page 1 6 4 3 2 5
  10. 10. 06/07/09 04:12 PM
  11. 11. 06/07/09 04:12 PM
  12. 12. 06/07/09 04:12 PM
  13. 13. <ul><li>BASIC CODE IN TEXT EDITOR </li></ul><ul><li>HOW IT LOOKS ON WEB BROWSER </li></ul>06/07/09 04:12 PM Revision Example 1
  14. 14. 06/07/09 04:12 PM
  15. 15. <ul><li>BASIC CODE IN TEXT EDITOR </li></ul><ul><li><?php </li></ul><ul><li>$my_name = “kanika”; </li></ul><ul><li>$My_name = “KANIKA”; </li></ul><ul><li>echo “hello, $my_name”; </li></ul><ul><li>echo “hello, $My_name”; </li></ul><ul><li>?> </li></ul><ul><li>Variable.php </li></ul><ul><li>HOW IT LOOKS ON WEB BROWSER </li></ul>06/07/09 04:12 PM Example 2
  16. 16. <ul><li>string (text) example, $name=“kanika” </li></ul><ul><li>integer (numeric) example, $value=100 </li></ul><ul><li>double (numeric) </li></ul><ul><li>Array </li></ul><ul><li>Object </li></ul><ul><li>unknown type </li></ul>06/07/09 04:12 PM
  17. 17. <ul><li>BASIC CODE IN TEXT EDITOR </li></ul><ul><li><?php </li></ul><ul><li>$years=2; </li></ul><ul><li>$rate=5; </li></ul><ul><li>$principal=1000; </li></ul><ul><li>$simple_interest= $years * $rate </li></ul><ul><li>* $principal ; </li></ul><ul><li>echo &quot;<h2>Simple Interest is Rs. </li></ul><ul><li>$simple_interest/-</h2>&quot;; </li></ul><ul><li>?> </li></ul><ul><li>simple_interest.php </li></ul><ul><li>HOW IT LOOKS ON WEB BROWSER </li></ul>06/07/09 04:12 PM Example 3
  18. 18. 06/07/09 04:12 PM <FORM> … </FORM>
  19. 19. <ul><li>Text fields <input name=“textbox_name” type=“text”> </li></ul><ul><li>Checkboxes <input name=“checkbox_name” type=“checkbox” value=“”> </li></ul><ul><li>Radio buttons <input name=“radio_name” type=“text” value=“”> </li></ul><ul><li>Listboxes <select name=“listbox_name[]” multiple> </li></ul><ul><li> <option>option1</option> </li></ul><ul><li> … </li></ul><ul><li> </select> </li></ul><ul><li>Passwords <input name=“textbox_name” type=“password”> </li></ul><ul><li>Submit and Reset buttons </li></ul><ul><li><input name=“textbox_name” type=“text”> </li></ul>06/07/09 04:12 PM
  20. 20. 06/07/09 04:12 PM
  21. 21. <ul><li>ACTION-tells the server which page to go to once the user has clicked a submit button on the form. </li></ul><ul><li><FORM ACTION=&quot;test.php&quot;> </li></ul><ul><li>... </li></ul><ul><li></FORM> </li></ul><ul><li>METHOD-controls the way that information is sent to the server. It can do this in one of two ways-GET and POST </li></ul><ul><li><FORM ACTION=&quot;test.php&quot; METHOD=GET> </li></ul><ul><li><FORM ACTION=&quot;test.php&quot; METHOD=POST> </li></ul><ul><li>ID, CLASS, DIR,LANGUAGE, NAME, STYLE, and TITLE </li></ul>06/07/09 04:12 PM
  22. 22. 06/07/09 04:12 PM
  23. 23. 06/07/09 04:12 PM
  24. 24. <ul><li>BASIC CODE IN TEXT EDITOR </li></ul><ul><li><HTML> </li></ul><ul><li><head><title> </li></ul><ul><li>Form page </li></ul><ul><li></title></head> </li></ul><ul><li><body> </li></ul><ul><li><FORM METHOD=GET ACTION=“name.php&quot;> </li></ul><ul><li>What is your name ? </li></ul><ul><li><INPUT NAME=“user” TYPE=&quot;TEXT&quot;> </li></ul><ul><li><BR> </li></ul><ul><li><BR> </li></ul><ul><li><INPUT TYPE=SUBMIT> </li></ul><ul><li></FORM> </li></ul><ul><li></body> </li></ul><ul><li></HTML> </li></ul><ul><li>Form_GET.php </li></ul><ul><li>HOW IT LOOKS ON WEB BROWSER </li></ul>06/07/09 04:12 PM Example 4(Using GET method)
  25. 25. <ul><li>BASIC CODE IN TEXT EDITOR </li></ul><ul><li><HTML> </li></ul><ul><li><HEAD></HEAD> </li></ul><ul><li><BODY> </li></ul><ul><li>YOUR NAME IS : </li></ul><ul><li><?php </li></ul><ul><li>echo $user; </li></ul><ul><li>?> </li></ul><ul><li></BODY> </li></ul><ul><li></HTML> </li></ul><ul><li>name.php </li></ul><ul><li>HOW IT LOOKS ON WEB BROWSER </li></ul>06/07/09 04:12 PM Example 4 continued….
  26. 26. <ul><li>BASIC CODE IN TEXT EDITOR </li></ul><ul><li><HTML> </li></ul><ul><li><head><title> </li></ul><ul><li>Form page </li></ul><ul><li></title></head> </li></ul><ul><li><body> </li></ul><ul><li><FORM METHOD=POST ACTION=“name.php&quot;> </li></ul><ul><li>What is your name ? </li></ul><ul><li><INPUT NAME=“user” TYPE=&quot;TEXT&quot;> </li></ul><ul><li><BR> </li></ul><ul><li><BR> </li></ul><ul><li><INPUT TYPE=SUBMIT> </li></ul><ul><li></FORM> </li></ul><ul><li></body> </li></ul><ul><li></HTML> </li></ul><ul><li>Form_GET.php </li></ul><ul><li>HOW IT LOOKS ON WEB BROWSER </li></ul>06/07/09 04:12 PM Example 5(Using POST method)
  27. 27. <ul><li>BASIC CODE IN TEXT EDITOR </li></ul><ul><li><HTML> </li></ul><ul><li><HEAD></HEAD> </li></ul><ul><li><BODY> </li></ul><ul><li>YOUR NAME IS : </li></ul><ul><li><?php </li></ul><ul><li>echo $user; </li></ul><ul><li>?> </li></ul><ul><li></BODY> </li></ul><ul><li></HTML> </li></ul><ul><li>name.php </li></ul><ul><li>HOW IT LOOKS ON WEB BROWSER </li></ul>06/07/09 04:12 PM Example 5 continued….
  28. 28. 06/07/09 04:12 PM
  29. 29. 06/07/09 04:12 PM THE END

×