Instant Ebooks Textbook Learning PHP, MySQL & JavaScript, 6th Edition Robin Nixon Download All Chapters
Instant Ebooks Textbook Learning PHP, MySQL & JavaScript, 6th Edition Robin Nixon Download All Chapters
com
https://textbookfull.com/product/learning-php-
mysql-javascript-6th-edition-robin-nixon/
https://textbookfull.com/product/learning-php-mysql-javascript-early-
release-6th-edition-robin-nixon/
textbookfull.com
https://textbookfull.com/product/learning-php-mysql-javascript-with-
jquery-css-html5-5th-edition-robin-nixon/
textbookfull.com
https://textbookfull.com/product/biota-grow-2c-gather-2c-cook-loucas/
textbookfull.com
https://textbookfull.com/product/energy-transitions-and-social-
psychology-a-sociotechnical-perspective-1st-edition-paul-upham/
textbookfull.com
We the People Essentials Twelfth Edition Andrea Campbell
& Benjamin Ginsberg & Theodore J. Lowi & Robert J. Spitzer
& Caroline J. Tolbert & Margaret Weir
https://textbookfull.com/product/we-the-people-essentials-twelfth-
edition-andrea-campbell-benjamin-ginsberg-theodore-j-lowi-robert-j-
spitzer-caroline-j-tolbert-margaret-weir/
textbookfull.com
https://textbookfull.com/product/molecular-pathology-in-clinical-
practice-2nd-edition-debra-g-b-leonard-eds/
textbookfull.com
https://textbookfull.com/product/fire-fundamentals-and-control-first-
edition-haessler/
textbookfull.com
https://textbookfull.com/product/adornos-aesthetics-as-a-literary-
theory-of-art-mario-farina/
textbookfull.com
https://textbookfull.com/product/roommates-life-in-the-brohouse-2-1st-
edition-carmen-black/
textbookfull.com
Learning PHP, MySQL &
JavaScript
SIXTH EDITION
With Early Release ebooks, you get books in their earliest form—
the author’s raw and unedited content as they write—so you can
take advantage of these technologies long before the official
release of these titles.
Robin Nixon
Learning PHP, MySQL & JavaScript
by Robin Nixon
Copyright © 2021 Robin Nixon. All rights reserved.
Printed in the United States of America.
Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North,
Sebastopol, CA 95472.
O’Reilly books may be purchased for educational, business, or sales
promotional use. Online editions are also available for most titles
(http://oreilly.com). For more information, contact our
corporate/institutional sales department: 800-998-9938 or
corporate@oreilly.com.
Copyeditor: TK
Proofreader: TK
Indexer: TK
Audience
This book is for people who wish to learn how to create effective and
dynamic websites. This may include webmasters or graphic
designers who are already creating static websites but wish to take
their skills to the next level, as well as high school and college
students, recent graduates, and self-taught individuals.
In fact, anyone ready to learn the fundamentals behind responsive
web design will obtain a thorough grounding in the core
technologies of PHP, MySQL, JavaScript, CSS, and HTML5, and you’ll
learn the basics of the React library and React Native Framework,
too.
Assumptions This Book Makes
This book assumes that you have a basic understanding of HTML
and can at least put together a simple, static website, but does not
assume that you have any prior knowledge of PHP, MySQL,
JavaScript, CSS, or HTML5—although if you do, your progress
through the book will be even quicker.
Supporting Books
Once you have learned to develop using PHP, MySQL, JavaScript,
CSS, and HTML5, you will be ready to take your skills to the next
level using the following O’Reilly reference books:
Dynamic HTML: The Definitive Reference by Danny
Goodman
PHP in a Nutshell by Paul Hudson
MySQL in a Nutshell by Russell Dyer
JavaScript: The Definitive Guide by David Flanagan
CSS: The Definitive Guide by Eric A. Meyer and Estelle Weyl
HTML5: The Missing Manual by Matthew MacDonald
Italic
Indicates new terms, URLs, email addresses, filenames, file
extensions, pathnames, directories, and Unix utilities. Also used
for database, table, and column names.
Constant width
NOTE
This element signifies a tip, suggestion, or general note.
WARNING
This element indicates a warning or caution.
NOTE
For more than 40 years, O’Reilly Media has provided technology and
business training, knowledge, and insight to help companies succeed.
How to Contact Us
Please address comments and questions concerning this book to the
publisher:
Sebastopol, CA 95472
We have a web page for this book, where we list errata, examples,
and any additional information. You can access this page at
Visit https://textbookfull.com
now to explore a rich
collection of eBooks, textbook
and enjoy exciting offers!
[[[ERRATA URL GOES HERE]]].
To comment or ask technical questions about this book, send email
to bookquestions@oreilly.com.
For news and more information about our books and courses, see
our website at http://www.oreilly.com.
Find us on Facebook: http://facebook.com/oreilly
Follow us on Twitter: http://twitter.com/oreillymedia
Watch us on YouTube: http://www.youtube.com/oreillymedia
Acknowledgments
I would like to thank Senior Content Acquisitions Editor, Amanda
Quinn, Content Development Editor, Melissa Potter, and everyone
who worked so hard on this book, including ???, ??? & ??? for their
comprehensive technical reviews, ??? for overseeing production, ???
for copy editing, ??? for proofreading, ??? for creating the index,
Karen Montgomery for the original sugar glider front cover design,
??? for the latest book cover, my original editor, Andy Oram, for
overseeing the first five editions, and everyone else too numerous to
name who submitted errata and offered suggestions for this new
edition.
Chapter 1. Introduction to
Dynamic Web Content
NOTE
It is necessary to start using some acronyms more or less right away. I
have tried to clearly explain them before proceeding, but don’t worry
too much about what they stand for or what these names mean,
because the details will become clear as you read on.
Using PHP
With PHP, it’s a simple matter to embed dynamic activity in web
pages. When you give pages the .php extension, they have instant
access to the scripting language. From a developer’s point of view,
all you have to do is write code such as the following:
<?php
echo " Today is " . date("l") . ". ";
?>
The opening <?php tells the web server to allow the PHP program
to interpret all the following code up to the ?> tag. Outside of this
construct, everything is sent to the client as direct HTML. So, the
text Here's the latest news. is simply output to the browser;
within the PHP tags, the built-in date function displays the current
day of the week according to the server’s system time.
The final output of the two parts looks like this:
NOTE
If you intend to enter the PHP examples in this book into a program
editor to work along with me, you must remember to add <?php in
front and ?> after them to ensure that the PHP interpreter processes
them. To facilitate this, you may wish to prepare a file called
example.php with those tags in place.
Using PHP, you have unlimited control over your web server.
Whether you need to modify HTML on the fly, process a credit card,
add user details to a database, or fetch information from a third-
party website, you can do it all from within the same PHP files in
which the HTML itself resides.
Using MySQL
Of course, there’s not a lot of point to being able to change HTML
output dynamically unless you also have a means to track the
information users provide to your website as they use it. In the early
days of the web, many sites used “flat” text files to store data such
as usernames and passwords. But this approach could cause
problems if the file wasn’t correctly locked against corruption from
multiple simultaneous accesses. Also, a flat file can get only so big
before it becomes unwieldy to manage—not to mention the difficulty
of trying to merge files and perform complex searches in any kind of
reasonable time.
That’s where relational databases with structured querying become
essential. And MySQL, being free to use and installed on vast
numbers of internet web servers, rises superbly to the occasion. It is
a robust and exceptionally fast database management system that
uses English-like commands.
The highest level of MySQL structure is a database, within which you
can have one or more tables that contain your data. For example,
let’s suppose you are working on a table called users, within which
you have created columns for surname, firstname, and email,
and you now wish to add another user. One command that you
might use to do this is as follows:
Using JavaScript
The oldest of the three core technologies discussed in this book,
JavaScript, was created to enable scripting access to all the elements
of an HTML document. In other words, it provides a means for
dynamic user interaction such as checking email address validity in
input forms and displaying prompts such as “Did you really mean
that?” (although it cannot be relied upon for security, which should
always be performed on the web server).
Combined with CSS (see the following section), JavaScript is the
power behind dynamic web pages that change in front of your eyes
rather than when a new page is returned by the server.
Random documents with unrelated
content Scribd suggests to you:
now seeking further light on the cause of gravitation; we are
interested in seeing what would really be involved in a complete
explanation of anything physical.
Einstein’s law in its analytical form is a statement that in empty
space certain quantities called potentials obey certain lengthy
differential equations. We make a memorandum of the word
“potential” to remind us that we must later on explain what it
means. We might conceive a world in which the potentials at every
moment and every place had quite arbitrary values. The actual world
is not so unlimited, the potentials being restricted to those values
which conform to Einstein’s equations. The next question is, What
are potentials? They can be defined as quantities derived by quite
simple mathematical calculations from certain fundamental
quantities called intervals. (MEM. Explain “interval”.) If we know the
values of the various intervals throughout the world definite rules
can be given for deriving the values of the potentials. What are
intervals? They are relations between pairs of events which can be
measured with a scale or a clock or with both. (MEM. Explain “scale”
and “clock”.) Instructions can be given for the correct use of the
scale and clock so that the interval is given by a prescribed
combination of their readings. What are scales and clocks? A scale is
a graduated strip of matter which.... (MEM. Explain “matter”.) On
second thoughts I will leave the rest of the description as “an
exercise to the reader” since it would take rather a long time to
enumerate all the properties and niceties of behaviour of the
material standard which a physicist would accept as a perfect scale
or a perfect clock. We pass on to the next question, What is matter?
We have dismissed the metaphysical conception of substance. We
might perhaps here describe the atomic and electrical structure of
matter, but that leads to the microscopic aspects of the world,
whereas we are here taking the macroscopic outlook. Confining
ourselves to mechanics, which is the subject in which the law of
gravitation arises, matter may be defined as the embodiment of
three related physical quantities, mass (or energy), momentum and
stress. What are “mass”, “momentum” and “stress”? It is one of the
most far-reaching achievements of Einstein’s theory that it has given
an exact answer to this question. They are rather formidable looking
expressions containing the potentials and their first and second
derivatives with respect to the co-ordinates. What are the potentials?
Why, that is just what I have been explaining to you!
The definitions of physics proceed according to the method
immortalised in “The House that Jack built”: This is the potential,
that was derived from the interval, that was measured by the scale,
that was made from the matter, that embodied the stress, that....
But instead of finishing with Jack, whom of course every youngster
must know without need for an introduction, we make a circuit back
to the beginning of the rhyme: ... that worried the cat, that killed the
rat, that ate the malt, that lay in the house, that was built by the
priest all shaven and shorn, that married the man.... Now we can go
round and round for ever.
But perhaps you have already cut short my explanation of
gravitation. When we reached matter you had had enough of it.
“Please do not explain any more, I happen to know what matter is.”
Very well; matter is something that Mr. X knows. Let us see how it
goes: This is the potential that was derived from the interval that
was measured by the scale that was made from the matter that Mr.
X knows. Next question, What is Mr. X?
Well, it happens that physics is not at all anxious to pursue the
question, What is Mr. X? It is not disposed to admit that its elaborate
structure of a physical universe is “The House that Mr. X built”.
Fig. 8
It looks upon Mr. X—and more particularly the part of Mr. X that
knows—as a rather troublesome tenant who at a late stage of the
world’s history has come to inhabit a structure which inorganic
Nature has by slow evolutionary progress contrived to build. And so
it turns aside from the avenue leading to Mr. X—and beyond—and
closes up its cycle leaving him out in the cold.
From its own point of view physics is entirely justified. That
matter in some indirect way comes within the purview of Mr. X’s
mind is not a fact of any utility for a theoretical scheme of physics.
We cannot embody it in a differential equation. It is ignored; and the
physical properties of matter and other entities are expressed by
their linkages in the cycle. And you can see how by the ingenious
device of the cycle physics secures for itself a self-contained domain
for study with no loose ends projecting into the unknown. All other
physical definitions have the same kind of interlocking. Electric force
is defined as something which causes motion of an electric charge;
an electric charge is something which exerts electric force. So that
an electric charge is something that exerts something that produces
motion of something that exerts something that produces ... ad
infinitum.
But I am not now writing of pure physics, and from a broader
standpoint I do not see how we can leave out Mr. X. The fact that
matter is “knowable to Mr. X” must be set down as one of the
fundamental attributes of matter. I do not say that it is very
distinctive, since other entities of physics are also knowable to him;
but the potentiality of the whole physical world for awaking
impressions in consciousness is an attribute not to be ignored when
we compare the actual world with worlds which, we fancy, might
have been created. There seems to be a prevalent disposition to
minimise the importance of this. The attitude is that “knowableness
to Mr. X” is a negligible attribute, because Mr. X is so clever that he
could know pretty much anything that there was to know. I have
already urged the contrary view—that there is a definitely selective
action of the mind; and since physics treats of what is knowable to
mind[43] its subject-matter has undergone, and indeed retains
evidences of, this process of selection.
“What is Mr. X?” In the light of these considerations let us now see
what we can make of the question, What is Mr. X? I must undertake
the inquiry single-handed; I cannot avail myself of your collaboration
without first answering or assuming an answer to the equally
difficult question, What are you? Accordingly the whole inquiry must
take place in the domain of my own consciousness. I find there
certain data purporting to relate to this unknown X; and I can (by
using powers which respond to my volition) extend the data, i.e. I
can perform experiments on X. For example I can make a chemical
analysis. The immediate result of these experiments is the
occurrence of certain visual or olfactory sensations in my
consciousness. Clearly it is a long stride from these sensations to any
rational inference about Mr. X. For example, I learn that Mr. X has
carbon in his brain, but the immediate knowledge was of something
(not carbon) in my own mind. The reason why I, on becoming aware
of something in my mind, can proceed to assert knowledge of
something elsewhere, is because there is a systematic scheme of
inference which can be traced from the one item of knowledge to
the other. Leaving aside instinctive or commonsense inference—the
crude precursor of scientific inference—the inference follows a
linkage, which can only be described symbolically, extending from
the point in the symbolic world where I locate myself to the point
where I locate Mr. X.
One feature of this inference is that I never discover what carbon
really is. It remains a symbol. There is carbon in my own brain-mind;
but the self-knowledge of my mind does not reveal this to me. I can
only know that the symbol for carbon must be placed there by
following a route of inference through the external world similar to
that used in discovering it in Mr. X; and however closely associated
this carbon may be with my thinking powers, it is as a symbol
divorced from any thinking capacity that I learn of its existence.
Carbon is a symbol definable only in terms of the other symbols
belonging to the cyclic scheme of physics. What I have discovered is
that, in order that the symbols describing the physical world may
conform to the mathematical formulae which they are designed to
obey, it is necessary to place the symbol for carbon (amongst
others) in the locality of Mr. X. By similar means I can make an
exhaustive physical examination of Mr. X and discover the whole
array of symbols to be assigned to his locality.
Will this array of symbols give me the whole of Mr. X? There is
not the least reason to think so. The voice that comes to us over the
telephone wire is not the whole of what is at the end of the wire.
The scientific linkage is like the telephone wire; it can transmit just
what it is constructed to transmit and no more.
It will be seen that the line of communication has two aspects. It
is a chain of inference stretching from the symbols immediately
associated with the sensations in my mind to the symbols descriptive
of Mr. X; and it is a chain of stimuli in the external world starting
from Mr. X and reaching my brain. Ideally the steps of the inference
exactly reverse the steps of the physical transmission which brought
the information. (Naturally we make many short cuts in inference by
applying accumulated experience and knowledge.) Commonly we
think of it only in its second aspect as a physical transmission; but
because it is also a line of inference it is subject to limitations which
we should not necessarily expect a physical transmission to conform
to.
The system of inference employed in physical investigation
reduces to mathematical equations governing the symbols, and so
long as we adhere to this procedure we are limited to symbols of
arithmetical character appropriate to such mathematical equations.
[44] Thus there is no opportunity for acquiring by any physical
investigation a knowledge of Mr. X other than that which can be
expressed in numerical form so as to be passed through a
succession of mathematical equations.
Mathematics is the model of exact inference; and in physics we
have endeavoured to replace all cruder inference by this rigorous
type. Where we cannot complete the mathematical chain we confess
that we are wandering in the dark and are unable to assert real
knowledge. Small wonder then that physical science should have
evolved a conception of the world consisting of entities rigorously
bound to one another by mathematical equations forming a
deterministic scheme. This knowledge has all been inferred and it
was bound therefore to conform to the system of inference that was
used. The determinism of the physical laws simply reflects the
determinism of the method of inference. This soulless nature of the
scientific world need not worry those who are persuaded that the
main significances of our environment are of a more spiritual
character. Anyone who studied the method of inference employed by
the physicist could predict the general characteristics of the world
that he must necessarily find. What he could not have predicted is
the great success of the method—the submission of so large a
proportion of natural phenomena to be brought into the prejudged
scheme. But making all allowance for future progress in developing
the scheme, it seems to be flying in the face of obvious facts to
pretend that it is all comprehensive. Mr. X is one of the recalcitrants.
When sound-waves impinge on his ear he moves, not in accordance
with a mathematical equation involving the physical measure
numbers of the waves, but in accordance with the meaning that
those sound-waves are used to convey. To know what there is about
Mr. X which makes him behave in this strange way, we must look not
to a physical system of inference, but to that insight beneath the
symbols which in our own minds we possess. It is by this insight that
we can finally reach an answer to our question, What is Mr. X?
[41] A good illustration of such substitution is afforded by
astronomical observations of a certain double star with two
components of equal brightness. After an intermission of
observation the two components were inadvertently interchanged,
and the substitution was not detected until the increasing
discrepancy between the actual and predicted orbits was inquired
into.
[42] For example, we should most of us assume (hypothetically)
that the dynamical quality of the world referred to in chapter V is
characteristic of the whole background. Apparently it is not to be
found in the pointer readings, and our only insight into it is in the
feeling of “becoming” in our consciousness. “Becoming” like
“reasoning” is known to us only through its occurrence in our own
minds; but whereas it would be absurd to suppose that the latter
extends to inorganic aggregations of atoms, the former may be
(and commonly is) extended to the inorganic world, so that it is
not a matter of indifference whether the progress of the inorganic
world is viewed from past to future or from future to past.
[43] This is obviously true of all experimental physics, and must
be true of theoretical physics if it is (as it professes to be) based
on experiment.
[44] The solitary exception is, I believe, Dirac’s generalisation
which introduces -numbers (p. 210). There is as yet no approach
to a general system of inference on a non-numerical basis.
Chapter XIII
REALITY
The Real and the Concrete. One of our ancestors, taking arboreal
exercise in the forest, failed to reach the bough intended and his
hand closed on nothingness. The accident might well occasion
philosophical reflections on the distinctions of substance and void—
to say nothing of the phenomenon of gravity. However that may be,
his descendants down to this day have come to be endowed with an
immense respect for substance arising we know not how or why. So
far as familiar experience is concerned, substance occupies the
centre of the stage, rigged out with the attributes of form, colour,
hardness, etc., which appeal to our several senses. Behind it is a
subordinate background of space and time permeated by forces and
unconcrete agencies to minister to the star performer.
Our conception of substance is only vivid so long as we do not
face it. It begins to fade when we analyse it. We may dismiss many
of its supposed attributes which are evidently projections of our
sense-impressions outwards into the external world. Thus the colour
which is so vivid to us is in our minds and cannot be embodied in a
legitimate conception of the substantial object itself. But in any case
colour is no part of the essential nature of substance. Its supposed
nature is that which we try to call to mind by the word “concrete”,
which is perhaps an outward projection of our sense of touch. When
I try to abstract from the bough everything but its substance or
concreteness and concentrate on an effort to apprehend this, all
ideas elude me; but the effort brings with it an instinctive tightening
of the fingers—from which perhaps I might infer that my conception
of substance is not very different from my arboreal ancestor’s.
So strongly has substance held the place of leading actor on the
stage of experience that in common usage concrete and real are
almost synonymous. Ask any man who is not a philosopher or a
mystic to name something typically real; he is almost sure to choose
a concrete thing. Put the question to him whether Time is real; he
will probably decide with some hesitation that it must be classed as
real, but he has an inner feeling that the question is in some way
inappropriate and that he is being cross-examined unfairly.
In the scientific world the conception of substance is wholly
lacking, and that which most nearly replaces it, viz. electric charge,
is not exalted as star-performer above the other entities of physics.
For this reason the scientific world often shocks us by its appearance
of unreality. It offers nothing to satisfy our demand for the concrete.
How should it, when we cannot formulate that demand? I tried to
formulate it; but nothing resulted save a tightening of the fingers.
Science does not overlook the provision for tactual and muscular
sensation. In leading us away from the concrete, science is
reminding us that our contact with the real is more varied than was
apparent to the ape-mind, to whom the bough which supported him
typified the beginning and end of reality.
It is not solely the scientific world that will now occupy our
attention. In accordance with the last chapter we are taking a larger
view in which the cyclical schemes of physics are embraced with
much besides. But before venturing on this more risky ground I have
to emphasise one conclusion which is definitely scientific. The
modern scientific theories have broken away from the common
standpoint which identifies the real with the concrete. I think we
might go so far as to say that time is more typical of physical reality
than matter, because it is freer from those metaphysical associations
which physics disallows. It would not be fair, being given an inch, to
take an ell, and say that having gone so far physics may as well
admit at once that reality is spiritual. We must go more warily. But in
approaching such questions we are no longer tempted to take up
the attitude that everything which lacks concreteness is thereby self-
condemned.
The cleavage between the scientific and the extra-scientific
domain of experience is, I believe, not a cleavage between the
concrete and the transcendental but between the metrical and the
non-metrical. I am at one with the materialist in feeling a
repugnance towards any kind of pseudo-science of the extra-
scientific territory. Science is not to be condemned as narrow
because it refuses to deal with elements of experience which are
unadapted to its own highly organised method; nor can it be blamed
for looking superciliously on the comparative disorganisation of our
knowledge and methods of reasoning about the non-metrical part of
experience. But I think we have not been guilty of pseudo-science in
our attempt to show in the last two chapters how it comes about
that within the whole domain of experience a selected portion is
capable of that exact metrical representation which is requisite for
development by the scientific method.
Causation and Time’s Arrow. Cause and effect are closely bound up
with time’s arrow; the cause must precede the effect. The relativity
of time has not obliterated this order. An event Here-Now can only
cause events in the cone of absolute future; it can be caused by
events in the cone of absolute past; it can neither cause nor be
caused by events in the neutral wedge, since the necessary
influence would in that case have to be transmitted with a speed
faster than light. But curiously enough this elementary notion of
cause and effect is quite inconsistent with a strictly causal scheme.
How can I cause an event in the absolute future, if the future was
predetermined before I was born? The notion evidently implies that
something may be born into the world at the instant Here-Now,
which has an influence extending throughout the future cone but no
corresponding linkage to the cone of absolute past. The primary
laws of physics do not provide for any such one-way linkage; any
alteration in a prescribed state of the world implies alterations in its
past state symmetrical with the alterations in its future state. Thus in
primary physics, which knows nothing of time’s arrow, there is no
discrimination of cause and effect; but events are connected by a
symmetrical causal relation which is the same viewed from either
end.
Primary physics postulates a strictly causal scheme, but the
causality is a symmetrical relation and not the one-way relation of
cause and effect. Secondary physics can distinguish cause and effect
but its foundation does not rest on a causal scheme and it is
indifferent as to whether or not strict causality prevails.
The lever in a signal box is moved and the signal drops. We can
point out the relation of constraint which associates the positions of
lever and signal; we can also find that the movements are not
synchronous, and calculate the time-difference. But the laws of
mechanics do not ascribe an absolute sign to this time-difference; so
far as they are concerned we may quite well suppose that the drop
of the signal causes the motion of the lever. To settle which is the
cause, we have two options. We can appeal to the signalman who is
confident that he made the mental decision to pull the lever; but this
criterion will only be valid if we agree that there was a genuine
decision between two possible courses and not a mere mental
registration of what was already predetermined. Or we can appeal to