1 / 45

PHP i MySQL

PHP i MySQL. Programy. PHP Triad 2.2.1 - 13.5MB – Freeware http://httpd.apache.org/ MySQL-Front – 1MB - Freeware ftp://ftp.home.pl/pub/windows/mysql Macromedia HomeSite 5.5 – 15MB – Trial http://www.macromedia.com Macromedia Dreamweaver 2004 MX – 80MB – Trial http://www.macromedia.com

Télécharger la présentation

PHP i MySQL

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. PHP i MySQL

  2. Programy • PHP Triad 2.2.1 - 13.5MB – Freewarehttp://httpd.apache.org/ • MySQL-Front – 1MB - Freeware ftp://ftp.home.pl/pub/windows/mysql • Macromedia HomeSite 5.5 – 15MB – Trialhttp://www.macromedia.com • Macromedia Dreamweaver 2004 MX – 80MB – Trialhttp://www.macromedia.com • Pomoc do programów Trial’owychhttp://www.crackspider.net

  3. PHP triad 2.2.1 • Serwer WWW – Apache • Serwer PHP • Serwer MySQL

  4. PHP triad 2.2.1

  5. PHP triad 2.2.1

  6. PHP triad 2.2.1

  7. MySQL-Front

  8. MySQL-Front

  9. MySQL-Front

  10. MySQL-Front

  11. MySQL-Front

  12. Macromedia HomeSite 5.5

  13. Macromedia HomeSite 5.5

  14. Macromedia HomeSite 5.5

  15. Macromedia Dreamweaver 2004 MX

  16. Macromedia Dreamweaver 2004 MX

  17. PHP i MySQL Przykład budowy internetowego systemu newsów

  18. baza danych

  19. Tworzenie bazy danych - PHP function create_db() { $db = mysql_pconnect($server, $login, $password); mysql_create_db('newsy'); print '<b>BAZA UTWORZONA</b><br />'; }

  20. Tworzenie tabel - PHP function create_table_logs() { $tab = 'logs'; mysql_select_db('newsy'); $newsy_tab = "create table $tab ( log_id smallint unsigned not null auto_increment primary key, log_date datetime not null default '0000-00-00 00:00:00', log_author_ip varchar(15) not null default '' )"; $zgloszenie = mysql_query($newsy_tab); echo 'tabela <b>'.$tab.'</b> utworzona<br />'; }

  21. Tworzenie rekordów - PHP function create_admin() //admin 123 { mysql_select_db('newsy'); $new_admin = "INSERT INTO users VALUES ('1', '21232f297a57a5a743894a0e4a801fc3', '202cb962ac59075b964b07152d234b70', '2004-04-19 19:49:52')"; $zgloszenie = mysql_query($new_admin); echo 'dodano <b>admina</b><br />'; }

  22. Tworzenie bazy danych - PHP

  23. Tworzenie bazy danych - PHP

  24. Tworzenie bazy danych - PHP

  25. System newsów

  26. Dodawanie newsa

  27. Dodawanie newsa $nick = addslashes($nick); $text = addslashes($text); $question = „insert into newsy (news_date, news_author, news_text, news_auhor_ip) values (now(), '$nick', '$text', '$ip')"; $result = mysql_query($question); print '<br /><b>Zapisano wiadomość</b>';

  28. Wyświetlanie newsów

  29. Wyświetlanie newsów - SQL $show_rec = 50; $question = "select news_id, news_date, news_author, news_text, news_author_ip from newsy order by news_date desc limit 0, $show_rec";

  30. Wyświetlanie newsów – PHP i html <tr><td bgcolor="#dee3e8" align="center" width="25"><font face="Verdana, Arial, Helvetica, sans-serif" size="1">'.$line[0].'</font></td>

  31. Anti-Flood System $show_rec = 1; $question = "select news_id, news_date, news_author, news_text news_author_ip from newsy order by news_date desc limit 0, $show_rec"; $result = mysql_query($question); $line = mysql_fetch_row($result); if ($nick == $line[2] && $text == $line[3]) print '<br /><b>Anti-Flood ALERT</b>';

  32. Anti-Flood System

  33. Anti-Flood System

  34. Wyszukiwanie newsów

  35. Wyszukiwanie newsów

  36. Wyszukiwanie newsów - html <form action="results.php" method="post"> <table border="1" bgcolor="#dee3e8" bordercolor="#5e7388"> <tr> <td><font face="Verdana, Arial, Helvetica, sans-serif" size="2">szukaj w:</font></td> <td align="right"> <select name="what"> <option value = "news_id"> ID (number) <option value = "news_date" selected> Data (yyyy-mm-dd hh:mm:ss) <option value = "news_author"> Autor (text) <option value = "news_text"> Text (text) </select>

  37. Wyszukiwanie newsów

  38. Wyszukiwanie newsów

  39. Wyszukiwanie newsów $question = „select news_id, news_date, news_author, news_text from newsy where ".$what." ".$operator." '%".$word."%' order by ".$sort." ".$az."";

  40. Panel Administratora

  41. Panel Administratora

  42. Panel Administratora if (MD5($admin_login)==$line[0] && MD5($admin_password)==$line[1])

  43. Panel Administratora

  44. The endWystępowali:MySQLPHPhtmlInni:PHP Triad 2.2.1MySQL-FrontMacromedia HomeSite 5.5Macromedia Dreamweaver 2004 MX

More Related