lectures/10/src10/blink.html 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. 38. 39. 40.
blink
lectures/10/src10/ajax/ajax1.html 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. 38. 39. 40. 41. 42. 43. 44. 45. 46. 47. 48.
76.
ajax1 77. 78. 79.
84. 85.
lectures/10/src10/ajax/ajax2.html 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. 38. 39. 40. 41. 42. 43. 44. 45. 46. 47. 48.
76.
ajax2 77. 78. 79.
86. 87.
lectures/10/src10/ajax/ajax3.html 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. 38. 39. 40. 41. 42. 43. 44. 45. 46. 47. 48.
ajax3 98. 99.
lectures/10/src10/ajax/ajax4.html 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. 38. 39. 40. 41. 42. 43. 44. 45. 46. 47. 48.
67.
ajax4 68. 69. 70.
75. 76.
lectures/10/src10/ajax/ajax5.html 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. 38. 39. 40. 41. 42. 43. 44. 45. 46. 47. 48.
74.
ajax5 75. 76. 77.
89. 90.
lectures/10/src10/ajax/ajax6.html 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. 38. 39. 40. 41. 42. 43. 44. 45. 46. 47. 48.
ajax6 53. 54.
lectures/10/src10/ajax/quote1.php 1.
/** * quote1.php * * Outputs price of given symbol as text/html. * * Computer Science 50 * David J. Malan */ // get quote $handle = @fopen("http://download.finance.yahoo.com/d/quotes.csv?s={$_GET["symbol"]}&f=e1l1", "r"); if ($handle !== FALSE) { $data = fgetcsv($handle); if ($data !== FALSE && $data[0] == "N/A") print($data[1]); fclose($handle); }
lectures/10/src10/ajax/quote2.php 1.
/** * quote2.php * * Outputs price, low, and high of given symbol as text/html, after * inserting an artificial delay. * * Computer Science 50 * David J. Malan */
// pretend server is slow sleep(5); // try to get quote $handle = @fopen("http://download.finance.yahoo.com/d/quotes.csv?s={$_GET["symbol"]}&f=e1l1hg", "r"); if ($handle !== FALSE) { $data = fgetcsv($handle); if ($data !== FALSE && $data[0] == "N/A") { print("Price: {$data[1]}"); print("
"); print("High: {$data[2]}"); print("
"); print("Low: {$data[3]}"); } fclose($handle); }
lectures/10/src10/ajax/quote3.php 1.
/** * quote3.php * * Outputs price, low, and high of given symbol as JSON. * * Computer Science 50 * David J. Malan */ // try to get quote $quote = array(); $handle = @fopen("http://download.finance.yahoo.com/d/quotes.csv?s={$_GET["symbol"]}&f=e1l1hg", "r"); if ($handle !== FALSE) { $data = fgetcsv($handle); if ($data !== FALSE && $data[0] == "N/A") { $quote["price"] = $data[1]; $quote["high"] = $data[2]; $quote["low"] = $data[3]; } fclose($handle); } header("Content-type: application/json"); print(json_encode($quote));
lectures/10/src10/forms/dump.php 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23.
dump
lectures/10/src10/forms/form1.html 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31.
form1
lectures/10/src10/forms/form2.html 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. 38. 39. 40. 41. 42. 43. 44. 45. 46. 47. 48.
form2 58. 59.
lectures/10/src10/forms/form3.html 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. 38. 39. 40. 41. 42. 43. 44. 45. 46. 47. 48.
form3 58. 59.
lectures/10/src10/forms/form4.html 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. 38. 39. 40. 41. 42. 43. 44. 45. 46. 47. 48.
52.
form4 53. 54. 55.
66. 67.
lectures/10/src10/forms/form5.html 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. 38. 39. 40. 41. 42. 43. 44. 45. 46. 47. 48.
form5 58. 59.
lectures/10/src10/forms/form6.html 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. 38. 39. 40. 41. 42. 43. 44. 45. 46. 47. 48.
form6
lectures/10/src10/forms/form6.html 49.
60. 61.
lectures/10/src10/forms/form7.html 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. 38. 39. 40. 41. 42. 43. 44. 45. 46. 47. 48.
51. 52.