دانلود کتاب Head First PHP & MySQL

عنوان فارسی :

دانلود کتاب سر اولین PHP و آمپر؛ خروجی زیر

عنوان انگلیسی :

Head First PHP & MySQL

زبان : English

موضوع : Computers->Programming: Programming Languages

نویسندگان : Lynn Beighley Michael Morrison

ناشر : O'Reilly Media

ISBN (شابک) : 0596006306, 0596556446, 9780596006303, 9780596556440

تعداد صفحات : 814\814

سال نشر : 2008     ویرایش : 1

حجم : 32 MB       فرمت : pdf

قیمت : 20000 تومان

فهرست :



Table of contents :
Head First PHP & MySQL......Page 7
Author(s) of Head First PHP & MySQL......Page 10
Table of Contents......Page 11
how to use this book: Intro ......Page 29
Who is this book for?......Page 30
We know what your brain is thinking......Page 31
Metacognition: thinking about thinking......Page 33
Here’s what WE did:......Page 34
Here’s what YOU can do to bend your brain into submission......Page 35
Read Me......Page 36
The technical review team......Page 38
Acknowledgments......Page 39
Safari(R) Books Online......Page 40
1 add life to your static pages: It’s Alive ......Page 41
HTML is static and boring......Page 42
PHP brings web pages to life......Page 43
Dogs in space......Page 44
A form helps Owen get the whole story......Page 45
Forms are made of HTML......Page 46
The HTML form has problems......Page 48
HTML acts on the CLIENT......Page 50
PHP acts on the SERVER......Page 51
PHP scripts run on the server......Page 52
Use PHP to access the form data......Page 56
PHP scripts must live on a server!......Page 58
Get your PHP scripts to the server......Page 59
The server turns PHP into HTML......Page 62
Deconstructing Owen’s PHP script......Page 64
A few PHP rules to code by......Page 65
Finding the perfect variable name......Page 66
Variables are for storing script data......Page 71
$_POST is a special variable that holds form data......Page 73
$_POST transports form data to your script......Page 74
Creating the email message body with PHP......Page 84
Even plain text can be formatted... a little......Page 86
Newlines need double-quoted strings......Page 87
Assemble an email message for Owen......Page 88
Variables store the email pieces and parts......Page 89
Sending an email message with PHP......Page 90
Owen starts getting emails......Page 93
Owen starts losing emails......Page 94
Your PHP & MySQL Toolbox......Page 97
2 Connecting to MySQL: How it fits together......Page 99
Owen’s PHP form works well. Too well.........Page 100
MySQL excels at storing data......Page 101
Owen needs a MySQL database......Page 102
Create a MySQL database and table......Page 104
The INSERT statement in action......Page 107
Use SELECT to get table data......Page 110
Let PHP handle the tedious SQL stuff......Page 113
PHP lets data drive Owen’s web form......Page 114
Connect to your database from PHP......Page 116
Insert data with a PHP script......Page 117
Use PHP functions to talk to the database......Page 118
Get connected with mysqli_connect()......Page 120
Build the INSERT query in PHP......Page 125
Query the MySQL database with PHP......Page 126
Close your connection with mysqli_close()......Page 127
$_POST provides the form data......Page 131
Owen needs help sifting through his data......Page 136
Owen’s on his way to finding Fang......Page 138
3 create and populate a database: Creating your own data ......Page 143
The Elvis store is open for business......Page 144
Elmer needs an application......Page 145
Visualize Elmer’s application design......Page 146
It all starts with a table......Page 149
Make contact with the MySQL server......Page 150
Create a database for Elmer’s emails......Page 151
Create a table inside the database......Page 152
We need to define our data......Page 153
Take a meeting with some MySQL data types......Page 154
Create your table with a query......Page 157
Getting the table in front of the database......Page 159
USE the database before you use it......Page 160
DESCRIBE reveals the structure of tables......Page 163
Elmer’s ready to store data......Page 165
Create the Add Email script......Page 166
The other side of Elmer’s application......Page 173
The nuts and bolts of the Send Email script......Page 174
First things first, grab the data......Page 175
mysqli_fetch_array() fetches query results ......Page 176
Looping for a WHILE......Page 179
Looping through data with while......Page 180
You’ve got mail...from Elmer!......Page 185
Sometimes people want out......Page 186
Removing data with DELETE......Page 187
Use WHERE to DELETE specific data......Page 188
Minimize the risk of accidental deletions......Page 189
MakeMeElvis.com is a web application......Page 194
Your PHP & MySQL Toolbox......Page 197
4 realistic and practical applications: Your Application on the Web ......Page 199
Elmer has some irritated customers......Page 200
Protecting Elmer from... Elmer......Page 203
Demand good form data......Page 204
The logic behind Send Email validation......Page 205
Your code can make decisions with IF......Page 206
Testing for truth......Page 207
IF checks for more than just equality......Page 208
The logic behind Send Email validation......Page 211
PHP functions for verifying variables......Page 212
Test multiple conditions with AND and OR......Page 219
Form users need feedback......Page 223
Ease in and out of PHP as needed......Page 233
Use a flag to avoid duplicate code......Page 234
Code the HTML form only once......Page 235
A form that references itself......Page 239
Point the form action at the script......Page 240
Check to see if the form has been submitted......Page 242
Some users are still disgruntled......Page 246
What Elmer’s table should contain:......Page 248
The five rules of primary keys:......Page 250
From checkboxes to customer IDs......Page 255
Loop through an array with foreach......Page 256
Your PHP & MySQL Toolbox......Page 261
5 working with data stored in files: When a database just isn't enough ......Page 263
Text can't be trusted......Page 264
The proof is in the picture......Page 265
The application needs to store images......Page 266
Planning for image file uploads in Guitar Wars......Page 271
The high score database must be ALTERed......Page 272
How do we get an image from the user?......Page 276
Insert the image filename into the database......Page 278
Find out the name of the uploaded file......Page 279
Where did the uploaded file go?......Page 284
Create a home for uploaded image files......Page 288
Shared data has to be shared......Page 294
Shared script data is required......Page 295
Think of require_once as "insert"......Page 296
Order is everything with high scores......Page 298
Honoring the top Guitar Warrior......Page 301
Format the top score with HTML and CSS......Page 302
Only small images allowed......Page 307
File validation makes the app more robust......Page 308
Plan for an Admin page......Page 312
Generate score removal links on the Admin page......Page 315
Scripts can communicate with each other......Page 316
Of GETs and POSTs......Page 318
GET, POST, and high score removal......Page 320
Isolate the high score for deletion......Page 323
Control how much you delete with LIMIT......Page 324
Your PHP & MySQL Toolbox......Page 333
6 securing your application: Assume they're all out to get you ......Page 335
The day the music died......Page 336
Where did the high scores go?......Page 337
Securing the teeming hordes......Page 339
Protecting the Guitar Wars Admin page......Page 340
HTTP authentication requires headers......Page 342
Take control of headers with PHP......Page 345
Authenticating with headers......Page 346
OK, so maybe Guitar Wars is NOT secure......Page 352
Create an Authorize script......Page 354
Guitar Wars Episode II : Attack of the High Score Clones ......Page 358
Subtraction by addition......Page 359
Security requires humans......Page 360
Plan for moderation in Guitar Wars......Page 361
Make room for approvals with ALTER......Page 362
Unapproved scores aren’t worthy......Page 367
The million-point hack......Page 370
Everything in moderation... ?......Page 371
How exactly did she do it?......Page 373
Tricking MySQL with comments......Page 374
The Add Score form was SQL injected......Page 375
Protect your data from SQL injections......Page 376
A safer INSERT (with parameters)......Page 377
Form validation can never be too smart......Page 379
Cease fire!......Page 381
Your PHP & MySQL Toolbox......Page 382
7 building personalized web apps: Remember me? ......Page 385
They say opposites attract......Page 386
Mismatch is all about personal data......Page 387
Mismatch needs user log-ins......Page 388
Come up with a user log-in gameplan......Page 389
Prepping the database for log-ins......Page 391
Constructing a log-in user interface......Page 393
Encrypt passwords with SHA()......Page 394
Making room for the encrypted password......Page 395
Authorizing users with HTTP......Page 398
Logging In Users with HTTP Authentication......Page 401
A form for signing up new users......Page 405
Give users a chance to sign up......Page 410
Sometimes you just need a cookie......Page 414
What’s in a cookie?......Page 415
Use cookies with PHP......Page 416
Rethinking the flow of log-ins......Page 419
A cookie-powered log-in......Page 420
Navigating the Mismatch application......Page 422
Logging out means deleting cookies......Page 425
Sessions aren’t dependent on the client......Page 429
The life and times of sessions......Page 430
Keeping up with session data......Page 431
Renovate Mismatch with sessions......Page 432
Log out with sessions......Page 433
Complete the session transformation......Page 438
Users aren’t feeling welcome......Page 444
Sessions are short-lived.........Page 446
... but cookies can last forever!......Page 447
Sessions + Cookies = Superior log-in persistence......Page 449
Your PHP & MySQL Toolbox......Page 454
7 1/2 eliminate duplicate code: Sharing is caring ......Page 457
Mismatch is in pieces......Page 461
Rebuilding Mismatch from a template......Page 462
Rebuild Mismatch with templates......Page 464
Mismatch is whole again... and much better organized......Page 466
8 control your data, control your world: Harvesting data ......Page 467
Making the perfect mismatch......Page 468
Mismatching is all about the data......Page 469
Break down the Mismatch data......Page 470
Model a database with a schema......Page 471
Wire together multiple tables......Page 476
Foreign keys in action......Page 477
Tables can match row for row......Page 478
One row leads to many......Page 479
Matching rows many-to-many......Page 480
Build a Mismatch questionnaire......Page 485
Get responses into the database......Page 486
We can drive a form with data......Page 490
Speaking of efficiency.........Page 495
Generate the Mismatch questionnaire form......Page 496
The data is now driving the form......Page 500
Strive for a bit of normalcy......Page 502
When normalizing, think in atoms......Page 503
Why be normal, really?......Page 504
Three steps to a normal database......Page 505
Altering the Mismatch database......Page 509
So is Mismatch really normal?......Page 510
A query within a query within a query.........Page 512
Let’s all join tables......Page 513
Connect with dots......Page 514
Surely we can do more with inner joins......Page 515
Simplifying ON with USING......Page 516
Nicknames for tables and columns......Page 517
Joins to the rescue......Page 518
Love is a numbers game......Page 524
Five steps to a successful mismatch......Page 525
Prepare for the mismatch search......Page 526
Compare users for "mismatchiness"......Page 527
All we need is a FOR loop......Page 528
Finishing the mismatching......Page 531
Your PHP & MySQL Toolbox......Page 539
9 string and custom functions: Better living through functions ......Page 541
A good risky job is hard to find......Page 542
The search leaves no margin for error......Page 544
SQL queries can be flexible with LIKE......Page 545
Explode a string into individual words......Page 550
implode() builds a string from substrings......Page 553
Preprocess the search string......Page 559
Replace unwanted search characters......Page 560
The query needs legit search terms......Page 564
Copy non-empty elements to a new array......Page 565
Sometimes you just need part of a string......Page 568
Extract substrings from either end......Page 569
Multiple queries can sort our results......Page 572
Functions let you reuse code......Page 576
Build a query with a custom function......Page 577
SWITCH makes far more decisions than IF......Page 582
Give build query() the ability to sort......Page 585
We can paginate our results......Page 588
Get only the rows you need with LIMIT......Page 589
Control page links with LIMIT......Page 590
Keep track of the pagination data......Page 591
Set up the pagination variables......Page 592
Revise the query for paginated results......Page 593
Generate the page navigation links......Page 594
Putting together the complete Search script......Page 597
The complete Search script, continued.........Page 598
Your PHP & MySQL Toolbox......Page 600
10 regular expressions: Rules for replacement ......Page 601
Risky Jobs lets users submit resumes......Page 602
Decide what your data should look like......Page 606
Formulate a pattern for phone numbers......Page 609
Match patterns with regular expressions......Page 610
Build patterns using metacharacters......Page 612
Fine-tune patterns with character classes......Page 619
Check for patterns with preg_match()......Page 624
Standardize the phone number data......Page 631
Get rid of the unwanted characters......Page 632
Matching email addresses can be tricky......Page 636
Domain suffixes are everywhere......Page 638
Use PHP to check the domain......Page 639
Email validation: putting it all together......Page 640
Your PHP & MySQL Toolbox......Page 644
11 visualizing your data... and more!: Drawing dynamic graphics ......Page 645
Guitar Wars Reloaded: Rise of the Machines......Page 646
No input form is safe......Page 647
We need to separate man from machine......Page 648
We can defeat automation with automation......Page 651
Generate the CAPTCHA pass-phrase text......Page 653
Visualizing the CAPTCHA image......Page 654
Inside the GD graphics functions......Page 656
The GD graphics functions continued.........Page 658
Drawing text with a font......Page 660
Generate a random CAPTCHA image......Page 663
Returning sanity to Guitar Wars......Page 665
Add CAPTCHA to the Add Score script......Page 667
Five degrees of opposability......Page 670
Charting mismatchiness......Page 671
Storing bar graph data......Page 672
From one array to another......Page 676
Build an array of mismatched topics......Page 678
Formulating a bar graphing plan......Page 679
Crunching categories......Page 680
Doing the category math......Page 681
Bar graphing basics......Page 684
Draw and display the bar graph image......Page 687
Individual bar graph images for all......Page 690
Mismatch users are digging the bar graphs......Page 693
Your PHP & MySQL Toolbox......Page 694
12 syndication and web services: Interfacing to the world ......Page 697
Owen needs to get the word out about Fang......Page 698
Push alien abduction data to the people......Page 699
RSS pushes web content to the people......Page 700
RSS is really XML......Page 701
From database to newsreader......Page 706
Visualizing RSS......Page 709
Dynamically generate an RSS feed......Page 712
Link to the RSS feed......Page 716
A video is worth a million words......Page 718
Pulling web content from others......Page 720
Syndicating YouTube videos......Page 721
Make a YouTube video request......Page 722
Owen is ready to build a REST request......Page 726
YouTube speaks XML......Page 730
Deconstruct a YouTube XML response......Page 734
Visualize the XML video data......Page 735
Access XML data with objects......Page 736
From XML elements to PHP objects......Page 737
Drill into XML data with objects......Page 738
Not without a namespace!......Page 739
Fang sightings are on the rise......Page 741
Lay out videos for viewing......Page 742
Format video data for display......Page 743
Your PHP & MySQL Toolbox......Page 751
The End.......Page 752
appendix i: leftovers: The Top Ten Topics (we didn't cover) ......Page 753
#1. Retrofit this book for PHP4 and mysql functions......Page 754
#2. User permissions in MySQL......Page 756
#3. Error reporting for MySQL......Page 758
#4. Exception handling PHP errors......Page 759
#4. Exception handling PHP errors (cont.)......Page 760
#5. Object-oriented PHP......Page 761
So two big advantages of using Object Oriented PHP are:......Page 762
#6. Securing your PHP application......Page 763
#6. Securing your PHP application (cont.)......Page 764
#7. Protect your app from cross-site scripting......Page 765
Data is guilty until proven innocent......Page 766
#8. Operator precedence......Page 767
More Unicode support......Page 768
OO refinements, XML support, and other changes......Page 769
WordPress......Page 770
appendix ii: set up a development environment: A place to play ......Page 771
Find out what you have......Page 772
Do you have PHP? Which version?......Page 773
Do you have MySQL? Which version?......Page 774
Start with the Web Server......Page 775
PHP installation......Page 776
PHP installation steps......Page 777
Instructions and Troubleshooting......Page 778
Steps to Install MySQL on Windows......Page 779
Download your installer......Page 780
Click "Install" and you’re done!......Page 781
Steps to Install MySQL on Mac OS X......Page 782
Moving from production to a live site......Page 784
Prepare to use your dumped data......Page 785
Move dumped data to the live server......Page 786
Connect to the live server......Page 787
appendix iii: extend your php: Get even more ......Page 789
If you’re using Windows, you’re in luck......Page 790
And on the Mac.........Page 793
A......Page 795
B......Page 796
C......Page 797
D......Page 798
E......Page 799
F......Page 800
G......Page 801
I......Page 802
M......Page 803
N......Page 805
P......Page 807
R......Page 809
S......Page 810
T......Page 812
V......Page 813
Y......Page 814





کتاب های پزشکی

دانلود کتاب Interpretation of canine and feline urinalysis

دانلود کتاب Analytical techniques for biopharmaceutical development

دانلود کتاب Repetitorium Schmerztherapie: Zur Vorbereitung auf die Prüfung "Spezielle Schmerztherapie"

دانلود کتاب Men's Health - Total Body Workbook

دانلود کتاب Drugs for Pregnant and Lactating Women, Second Edition: Expert Consult - Online and Print

کتاب های کامپیوتر

دانلود کتاب MySQL Cookbook, 2nd Edition

دانلود کتاب The definitive guide to MySQL 5

دانلود کتاب HTML5 Guidelines for Web Developers

دانلود کتاب Sams teach yourself ADO.NET in 24 hours

دانلود کتاب Programming Reactive Extensions and Linq

کتاب های ریاضی

دانلود کتاب A first course in Wavelets with Fourier analysis

دانلود کتاب Mathematics and the Laws of Nature: Developing the Language of Science (The History of Mathematics)

دانلود کتاب Quantum Methods with Mathematica. Supplementary files

دانلود کتاب Latent Variable Models: An Introduction to Factor, Path, and Structural Equation Analysis

دانلود کتاب Moduli Spaces and Vector Bundles

کتاب های تکنولوژی

دانلود کتاب Hormones and Reproduction of Vertebrates - Volume 5: Mammals

دانلود کتاب Protein Methods

دانلود کتاب Nanowires and Nanobelts: Materials, Properties and Devices. Volume 1: Metal and Semiconductor Nanowires

دانلود کتاب Composite Reinforcements for Optimum Performance

دانلود کتاب HPLC of Peptides and Proteins: Methods and Protocols

کتاب های مذهبی

دانلود کتاب Slavery, Sabbath, War and Women: Case Issues in Biblical Interpretation (Conrad Grebel Lecture)

دانلود کتاب A Holy People: Jewish and Christian Perspectives on Religious Communal Identity

دانلود کتاب Old Testament Theology: 1 (Old Testament Library)

دانلود کتاب The Old Testament and Criticism

دانلود کتاب Religion and Society in Roman Palestine: Old Questions, New Approaches

کتاب های فیزیولوژی

دانلود کتاب Feminist Stylistics

دانلود کتاب Psychoanalyse und Psychiatrie: Geschichte, Krankheitsmodelle und Therapiepraxis

دانلود کتاب How to Motivate Reluctant Learners (Mastering the Principles of Great Teaching Series)

دانلود کتاب Kama Sutra 365

دانلود کتاب Identity, Motivation and Autonomy in Language Learning (Second Language Acquisition)

کتاب های تاریخی

دانلود کتاب Rumpler C.I

دانلود کتاب Spitfire Mk.I-II

دانلود کتاب The ''Reluctant Dragon'': The Curtiss SO3C Seagull/Seamew

دانلود کتاب Sea Eagles Volume One: Luftwaffe Anti-Shipping Units 1939-1941 (Luftwaffe Colours)

دانلود کتاب The Matter of the Page: Essays in Search of Ancient and Medieval Authors (Wisconsin Studies in Classics)

کتاب های زیست شناسی

دانلود کتاب Monsters and Animals

دانلود کتاب Visual Methods in Social Research

دانلود کتاب Advances in Environmental Research, Volume 13

دانلود کتاب From Genesis to Genetics: The Case of Evolution and Creationism

دانلود کتاب Recent Developments in Mass Spectrometry in Biochemistry and Medicine: Volume 2

کتاب های اقتصاد

دانلود کتاب The Economist - 19 May 2001

دانلود کتاب Managerial Accounting 2010 Edition

دانلود کتاب Analog Integrated Circuits-Power management Signal conditioning and ASSP

دانلود کتاب Neurogener Schmerz: Management von Diagnostik und Therapie

دانلود کتاب Marketing Planning: Strategy, Environment and Context

کتاب های آموزشی

دانلود کتاب Joomla! For Dummies

دانلود کتاب Atlas of the Messier Objects: Highlights of the Deep Sky

دانلود کتاب The Complete Idiot's Guide to Global Economics

دانلود کتاب Cambridge - Objective First Certificate (FCE)

دانلود کتاب Teach Yourself Visually Knitting Design: Working from a Master Pattern to Fashion Your Own Knits

کتاب های حقوق

دانلود کتاب Crime And Punishment In England: An Introductory History

دانلود کتاب Dispute settlement in the UN Convention on the Law of the Sea

دانلود کتاب The Essential Law Dictionary (Sphinx Dictionaries)

دانلود کتاب Encyclopedia of War Crimes And Genocide (Facts on File Library of World History)

دانلود کتاب Analysis of evidence

کتاب های علوم انسانی

دانلود کتاب Darkwerks: The Art of Brom

دانلود کتاب Process and Reality: An Essay in Cosmology

دانلود کتاب Children's Folklore: A Source Book

دانلود کتاب Inside Out Advanced: Workbook with Key

دانلود کتاب Art And Social Change: Contemporary Art In Asia And The Pacific