A Web Based Introduction to Programming Essential Algorithms Syntax and Control Structures Using Php Html and Mariadb MySQL Mike O’Kane All Chapters Instant Download
A Web Based Introduction to Programming Essential Algorithms Syntax and Control Structures Using Php Html and Mariadb MySQL Mike O’Kane All Chapters Instant Download
com
https://textbookfull.com/product/a-web-based-introduction-
to-programming-essential-algorithms-syntax-and-control-
structures-using-php-html-and-mariadb-mysql-mike-okane/
OR CLICK BUTTON
DOWNLOAD NOW
PHP and MySQL for Dynamic Web Sites Fifth Edition Ullman
https://textbookfull.com/product/php-and-mysql-for-dynamic-web-sites-
fifth-edition-ullman/
textboxfull.com
https://textbookfull.com/product/php-and-mysql-web-development-5th-
edition-developer-s-library-luke-welling/
textboxfull.com
https://textbookfull.com/product/learn-php-8-using-mysql-javascript-
css3-and-html5-second-edition-steve-prettyman/
textboxfull.com
https://textbookfull.com/product/essential-algorithms-a-practical-
approach-to-computer-algorithms-using-python-and-c-second-edition-rod-
stephens/
textboxfull.com
Beginning PHP and MySQL: From Novice to Professional 5th
Edition Frank M. Kromann
https://textbookfull.com/product/beginning-php-and-mysql-from-novice-
to-professional-5th-edition-frank-m-kromann/
textboxfull.com
https://textbookfull.com/product/problem-solving-in-data-structures-
algorithms-using-c-programming-interview-guide-first-edition-hemant-
jain/
textboxfull.com
https://textbookfull.com/product/problem-solving-in-data-structures-
algorithms-using-c-programming-interview-guide-1st-edition-hemant-
jain/
textboxfull.com
https://textbookfull.com/product/learning-php-mysql-javascript-6th-
edition-robin-nixon/
textboxfull.com
https://textbookfull.com/product/introduction-to-java-programming-and-
data-structures-comprehensive-version-y-daniel-liang/
textboxfull.com
A Web-Based Introduction
to Programming
2
A Web-Based Introduction
to Programming
3
Essential Algorithms, Syntax,
and Control Structures Using PHP, HTML,
and MariaDB/MySQL
Fourth Edition
Mike O'Kane
4
Copyright © 2017
Mike O'Kane
All Rights Reserved.
eISBN 978-1-53100-707-2
www.cap-press.com
No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or by any
means, electronic, mechanical, recording or otherwise, without the prior written permission of the author.
Please note: The information in this book is provided for instructional value and distributed on an “as is” basis,
without warranty. While every precaution has been taken in the preparation of the book, neither the author nor
Carolina Academic Press shall have any liability to any person or entity with respect to any loss or damage caused
by or alleged to be caused, directly or indirectly, by the instructions contained in this book or by the programs or
applications that are listed in, or provided as supplements to, this book.
Macintosh®, Mac OS®, Safari, and iOS® are registered trademarks of Apple, Inc. in the United States and other
countries. Windows® and Windows Mobile® are registered trademarks of Microsoft Corporation in the United
States and other countries. Linux® is the registered trademark of Linus Torvalds in the United States and other
countries. MySQL® is a registered trademark of Oracle Corporation and/or its affiliates. MariaDB® is a registered
trademark of MariaDB Corporation Ab. Mozilla® and Firefox® are registered trademarks of the Mozilla
Foundation. Joomla!® is trademarked by Open Source Matters. Apache® is a trademark of the Apache Software
Foundation. XAMPP and Apache Friends are registered trademarks of BitRock. The WordPress® trademark is
owned by the WordPress Foundation. Android® and Google Chrome® are trademarks of Google Inc. The Drupal®
trademark is owned and controlled by Dries Buytaert. BlackBerry® is a trademark of Blackberry. All product
names identified in this book are trademarks or registered trademarks, and are the properties of their respective
companies. We have used these names in an editorial fashion only, and to the benefit of the owner, with no
5
intention of infringing the trademark.
6
To my dear mother and father,
thank you for the love and light that you bestowed on us.
7
Contents
Preface
Acknowledgments
About the Author
8
Creating an Interactive HTML and PHP Program
Summary
Chapter 2 Review Questions
Chapter 2 Code Exercises
9
Summary
Chapter 4 Review Questions
Chapter 4 Code Exercises
10
PHP Functions to Parse a Delimited Character String
Processing a File with Multiple Records
Appending Records to a File
Working with Multiple Files
Summary
Chapter 6 Review Questions
Chapter 6 Code Exercises
11
Chapter 8 Code Exercises
12
Chapter 11 · Structured Data — Working with Arrays
Introduction
What Is an Array?
Working with Array Elements
Extending an Array
Displaying Array Values
Receiving Scores into an Array from an HTML Form
Arrays of Strings
How Large Is the Array?
Why Do Array Indices Begin with 0 and Not 1?
Using FOR Loops with Arrays
Using the sizeof() Function to Control a FOR Loop
Summing and Averaging the Values in an Array
Counting Selected Values in an Array
Multiple Operations on an Array
Reading Data from a File into an Array
Reading Data into an Array from a File of Unknown Length
Using [] with no Index Value
Reading Selected Data from a File into an Array
Reading Data from a File into Multiple Arrays
Reading Selected Data from a File of Records into an Array
More About the explode() and list() Functions
A Special Loop for Processing Arrays — FOREACH
Multi-Dimensional Arrays
Summary
Chapter 11 Review Questions
Chapter 11 Code Exercises
13
Chapter 12 Code Exercises
14
Performing JOIN Operations on Multiple Tables
Using INSERT to Add Records to a Table
Using UPDATE to Modify a Record
Removing a Record
Storing MySQL Connection Data in an Include File
Creating, Dropping, and Altering Databases and Tables
Summary
Chapter 14 Review Questions
Chapter 14 Code Exercises
15
Graphical User Interfaces and Interface Design
Web Design and Content Management
Database Programming and SQL
In Summary: Follow Your Heart!
16
Appendix E · More about HTML and CSS
Useful HTML References
Useful CSS References
Inline Styles and Internal Style Sheets
Deprecated HTML Tags
Frequently Asked Questions Regarding HTML Tags
Index
17
Preface
The problem I have tried to solve with this textbook is, quite simply, how to effectively introduce general
programming concepts to students who have never programmed before. Perhaps like me, you have found yourself
frustrated by textbooks that try to cover too much too fast, make inappropriate assumptions about what a student
already knows, or take sudden leaps in complexity when providing examples and exercises.
I believe that the purpose of an introductory programming course is to help students gain confidence and
develop their understanding of basic logic, syntax, and problem-solving. They do not need to learn all aspects of a
language or even learn best practices—these are topics for the next course level. The question is: how to provide
the kind of hands-on experience that supports active learning without overwhelming the beginning student with
too much syntactical and programmatic detail?
I have tried many approaches over the years before settling on a Web-based approach, using PHP, CSS, and
HTML code to develop small, interactive Web applications. This approach has proved very successful. Many
students report how much they enjoy the course, how much they have learned, and how well the material has
served them in subsequent courses and in their professional life. I also hear from many students who tell me that
the course positively changed their opinion of programming as a career or subject of interest, which is most
gratifying.
Some instructors may have concerns that my coverage of the PHP and HTML is insufficient. The book uses a
small number of HTML tags, CSS rules, and PHP functions, and employs some arbitrary conventions to simplify
the code and keep the focus on basic concepts common to most languages. For example, PHP print statements
are used rather than echo statements, and these statements always include parentheses and double quotes so that
the syntax is more consistent with the output statements of most other languages. The last chapter (“Where to Go
From Here”) clarifies which practices are standard and which are particular to the textbook.
18
Intended Audience
The book is designed to serve:
Instructors teaching introductory programming, programming logic and design, or Web programming
courses, who want a textbook that engages students and provides a solid preparation for subsequent courses,
but avoids overwhelming beginners with too much syntactical detail or program complexity.
Traditional and online students taking a first course in programming, programming logic and design, or
Web programming.
Web designers, graphic artists, technical communicators, and others who find that their work increasingly
requires some degree of programming expertise, and need an effective, hands-on introduction.
Others who wish to learn the basics of programming, either for personal interest, or to explore the
possibility of a career in this field.
Note that solutions to quizzes and exercises are only available to verified course instructors.
19
Approach
The book takes a fairly novel approach, allowing students to learn program logic and design by developing a large
number of small Web-based applications. Students love working with the Web, and this approach has other
important benefits:
Important concepts such as client/server design, server-side processing, and interface-driven code modules
can be introduced in the form of working applications, and then applied in hands-on exercises.
Students not only learn the essential control structures and syntax of a programming language, but also learn
to use a markup language (and associated style sheets), and a database query language to access and query a
database. This makes sense in today's programming environment where these languages are routinely used
in combination to develop a networked application.
The material is relevant to students across a range of disciplines: Computer Science, Information Systems,
Technical Communications, Network Systems, Digital Media, Web Technologies, Mobile Applications,
Database Programming, and other technology-related fields.
The focus on hands-on problem-solving and fundamental structures prepare students for next-level,
language-specific courses such as PHP, Python, Java or C++, as well as Web design and database courses,
without replicating a great deal of material, while the syntax covered here is generally consistent with these
and other languages.
The book makes use of a programming language (PHP), a scripting language (HTML), a style sheet language
(CSS), and a database query language (MariaDB or MySQL), but does not attempt to provide a complete
overview of these languages. Instead, students learn sufficient syntax to convert requirements into working
applications using basic programming structures, arithmetic and logical expressions, user interfaces, functions,
data files, and SQL queries. The focus remains on basic concepts, logic and design, algorithm development, and
common programming procedures. The book provides context throughout, explaining why each topic is
important, and referring students to related career paths.
Although the book focuses on Web-based applications, there is NO requirement for a network-based
programming environment. The book uses a fully functional but standalone Apache Web server (the open source
xampp distribution provided by the Apache Friends group) that students can install on a USB drive or home
computer simply by unzipping a file. Students can begin programming in HTML, PHP and MariaDB or
MySQL in literally minutes.
20
Features
Each chapter begins with clearly stated learning outcomes. Each topic is introduced using examples of simple
program requirements that are first developed as algorithms and interfaces and then realized in working code.
Code statements and control structures are explained step by step.
Different programming topics are treated in separate chapters. Even topics that are commonly combined, such
as counting loops and event-controlled loops, have their own chapters so that students have the chance to develop
and apply their understanding of each separately.
Each chapter includes quizzes that have been carefully developed to test the student's understanding of the
chapter's learning outcomes. The questions have been tested extensively in the classroom.
Three different types of coding exercise are provided at the end of each chapter:
Fixit exercises provide small programs that include a single error of some kind. These exercises help students
improve their problem-solving ability, test their understanding of key concepts, and develop tracing and
debugging skills.
Modify exercises provide working programs that must be modified to perform a somewhat different or
additional function. These exercises help students determine how and where to add new code, and test their
ability to read and understand existing code.
Code completion exercises allow students to apply concepts and tools covered in the chapter by developing
new applications. These exercises test the student's ability to: understand requirements, develop algorithms,
and produce working code. The code completion exercises follow consistent themes that are developed
throughout the book, so that students can more readily appreciate the value of new functionalities that they
learn in each chapter.
Templates for each exercise contain partially completed code so students don't waste time typing (and debugging)
code that is not relevant to the problem at hand. The templates also help instructors to streamline the grading
process.
The textbook comes with a standalone Web server that can be installed on a fixed or portable drive simply by
unzipping a file (so students can bring the software with them to work on computers at any location).
The server installation includes textbook folders that contain all code samples and exercise templates. Students
can complete the exercises simply by opening, editing, and saving the appropriate files. Assignments can be turned
in simply by zipping and submitting the appropriate chapter folder.
The textbook appendices provide additional learning resources designed to: (a) help individual students with
particular needs or interests (for example file/folder management, additional references, and help debugging
code); and (b) deliver useful topics not included in the chapters (for example data representation, additional
control structures, and multi-dimensional arrays).
21
Textbook Web Site
The textbook Web site ensures that both students and instructors have access to the most current resources
associated with this textbook. The Web site includes: everything you need to install and use the Web server; slide
presentations; and hints and help for students working through each chapter. The Web site also provides support
for verified instructors, including additional exercises, test banks, slide presentations, quiz solutions, code
solutions, and other instructional resources. The Web site can be found at:
http://www.mikeokane.com/textbooks/WebTech/
22
Changes to the Fourth Edition
In addition to minor corrections and improvements, this fourth edition of the book includes: a new install of the
xampp Apache Web server distribution with installation instructions for Windows, Mac OS, and Linux; revised
file naming conventions that are more standard for current web development; a hopefully improved redesign of
Chapters 7 and 8; additional materials and improvements to Chapter 13 (functions); references to both MySQL
and MariaDB in Chapter 14 (the actual code and descriptions are identical); a new Chapter 15 that introduces
Object-Oriented Programming.
23
Chapter Overview
Chapter 1: Introducing Computer Programming. Students learn the relationship between machine language
and high-level languages, and review common tasks that computer programs typically perform. The work of a
programmer is described, and the software development cycle is explained. The chapter highlights and briefly
summarizes design approaches such as algorithm development, interface design, client/server design and object-
oriented programming. Different programming languages are identified, and the distinction is made between
interpreted and compiled languages, and between markup and programming languages. Standalone and network
applications are also contrasted.
Chapter 2: Client/Server Applications—Getting Started. This chapter prepares students for the hands-on
work they will perform in subsequent chapters. File types and local and Internet addressing schemes are explained.
Instructions are provided to install, run, and test the required software. Students are shown how to create, store,
and run a number of sample applications in order to become familiar with the process of using a text editor,
saving files, running the Web server, and viewing the results in a Web browser.
Chapter 3: Program Design—from Requirements to Algorithms. The general characteristics and
requirements of effective instructions are explored, using human and program examples. Students walk through
the process of reviewing simple requirements, creating input, processing, and output (IPO) charts, designing the
interface, and developing solution algorithms. The chapter introduces sequence, selection and control structures,
variables and assignment operations, and arithmetic and logical expressions.
Chapter 4: Basics of Markup—Creating a User Interface with HTML. This chapter explains the significance
of data rendering, and provides a brief overview and history of Hypertext Markup Language (HTML).
Commonly used HTML tags are explained, and the student is shown how to apply these to create and organize
simple Web pages. Cascading style sheets are introduced. Students are shown how to create HTML forms to
obtain user input as a first step in developing interactive Web applications. HTML Tables are used to perform
simple form layout.
Chapter 5: Creating a Working Program—Basics of PHP. This chapter teaches sufficient PHP language
syntax to process user input received from HTML forms, perform simple arithmetic, and produce formatted
output. In the process, students learn to code arithmetic expressions, use standard operators and functions, create
and work with variables, and identify and fix both syntax and logical errors.
Chapter 6: Persistence—Saving and Retrieving Data. This chapter explains the difference between persistent
and transient data, and introduces text file processing as well as basic database concepts. Students learn to: open,
read, write, and close text files; work with multiple files; parse lines of data that contain multiple values separated
by some kind of delimiter.
Chapter 7: Programs that Choose—Introducing Selection Structures. This chapter introduces selection
control structures and demonstrates the use of algorithms to solve problems requiring simple selection. Students
learn to use IF and IF..ELSE structures, Boolean expressions, relational operators, truth tables, simple string
comparisons, and testing procedures.
Chapter 8: Multiple Selection, Nesting, ANDs and ORs. This chapter develops examples from Chapter 7 to
handle problems associated with input validation and more complex requirements. Students explore the use of
compound Boolean expressions, nested selection structures, chained IF..ELSEIF..ELSE selection structures, and
multiple but independent selection structures.
Chapter 9: Programs that Count—Harnessing the Power of Repetition. This chapter introduces loop
structures with a focus on count-controlled FOR loops. Students learn how to refer to the counting variable
within the loop, and how to use loops to generate tables, crunch numbers, accumulate totals, find highest and
lowest values in a series, select values from a file of records, and display bar charts.
Chapter 10: “While NOT End-Of-File”—Introducing Event-Controlled Loops. This chapter introduces
WHILE loops and demonstrates the use of the priming read and the standard algorithm to process files of
unknown length. The student is shown how WHILE loops can be used to perform various operations on a list of
24
data values, and how a file of records can be processed and searched for specific records or field values.
Chapter 11: Structured Data—Working with Arrays. This chapter introduces numerically-indexed arrays,
and shows how arrays can be used to store, access, and update multiple-related values. The use of the FOR loop
to process arrays is explained, and various array-processing algorithms are demonstrated.
Chapter 12: Associative Arrays. This chapter introduces associative arrays. Students learn how to use
associative arrays as lookups, and gain a better understanding of the $_POST array and the way that data is
received from HTML forms. Web sessions are introduced, and students learn how to use the $_SESSION array
to maintain session data between applications.
Chapter 13: Program Modularity—Working with Functions. This chapter demonstrates the importance of
program modularity and introduces functions, include files and objects. Students learn to write their own
functions, to build libraries of related functions, and to call functions from different applications as needed.
Chapter 14: Connecting to a Database—Working with MySQL. This chapter introduces databases queries
as an important application tool. The relationship between relational databases and SQL is explained, along with
the purpose and syntax of common queries (SELECT, INSERT, UPDATE and DELETE). Students learn to
write code to open and close database connections, submit queries, handle errors, perform simple joins, and
process results.
Chapter 15: Introduction to Object-Oriented Programming. This chapter introduces Object-Oriented
Programming. Examples show how simple object classes are designed, how class variables are encapsulated and
accessed by class methods, how objects are instantiated and used in applications, and how classes can be inherited
by other classes. An overview of basic OO terminology is provided.
Chapter 16: Where to Go From Here. This last chapter provides a short overview of key concepts and
technologies that the students may want to explore after completing this textbook, along with clarification of
some of the conventions followed in the book.
The textbook also includes a number of useful appendices as follows:
Appendix A introduces data representation, and shows how binary values can store data for a wide range of
purposes.
Appendix B provides an introduction to overview of file and folder management, file addressing schemes
(including relative and absolute addresses), and the use of the command line with a list of common DOS and
Unix command equivalents.
Appendix C provides help for students wishing to use different Web server installations.
Appendix D provides debugging help for students having trouble identifying and resolving PHP code errors.
Appendix E provides additional material and references for students wishing to learn more about HTML and
style sheets.
Appendix F provides additional information regarding PHP data types, and provides a list of common PHP
functions not covered in the book.
Appendix G provides additional coverage of common PHP operators and structures that were omitted from
the chapters to avoid overwhelming the beginning student (for example, shortcut operators, the SWITCH
statement, DO..WHILE loops, and multi-dimensional arrays).
25
Acknowledgments
This textbook could not have been created without the generous help and support of many others. In particular I
want to thank my dear wife Constance Humphries for her invaluable technical advice, proof-reading,
development of video tutorials, and daily encouragement and patience! My sincere thanks to Scott Sipe, Beth
Hall, Sara Hjelt, and all at Carolina Academic Press for their supportive style, professionalism and experience.
Thanks to all my fellow instructors at A-B Tech (Asheville-Buncombe Technical Community College), especially
to Charlie Wallin and Fred Smartt who field-tested the first edition, and provided invaluable suggestions and
corrections. And thanks to all of those students who have learned with me and sometimes in spite of me as this
book evolved in the classroom. A particular thank you to A-B Tech students Uma Benson, Jean-Jacques Maury,
and Kenneth Stanley, who all voluntarily provided me with carefully compiled lists of corrections that were
incorporated into the fourth edition. Their engagement with the material and concern for future students is
greatly appreciated. Any remaining errors or inconsistencies are of course my own.
Lastly, a huge thank you to Kai ‘Oswald’ Seidler, Kay Vogelgesang, and all those who have contributed to the
Apache Friends Project, and who continue to deliver and support the XAMPP distribution. So many of us owe
you our great appreciation for your generosity of spirit!
26
About the Author
Mike O'Kane holds a master's degree in Systems Science (specializing in Advanced Technology) from
Binghamton University. He has over eighteen years' experience teaching computer science courses, most recently
at Asheville-Buncombe Technical Community College in North Carolina. He also has extensive practical
experience in the use of technology for learning, having worked at IBM as a short-course developer, NC State
University as an Instructional Coordinator, and the University of North Carolina system as the first Executive
Director of the UNC Teaching and Learning with Technology Collaborative. He has a passion for developing
effective instructional content, and learning environments that promote rather than hinder student learning.
27
Chapter 1
28
Introduction
Welcome! If you have never programmed before, this book is for you. By the time you complete the chapters and
exercises, you will have a good grasp of the basic logic and design of computer programs. The book is designed to
teach common programming syntax and control structures in a manner that will prepare you for further study in
this field, and provide you with sufficient expertise to develop small, interactive Web applications, using a
combination of the HTML markup language and PHP programming language. You will also be introduced to
the CSS stylesheet language, and the MariaDB and MySQL database languages.
To get started, in this first chapter we will explore the general process of programming and define some
important term and practices. For a book that is supposed to be hands-on this chapter is mostly descriptive! Don't
be too concerned if some of the topics don't make complete sense yet. Your understanding will deepen as you
work through the chapters and develop your own applications.
29
Exploring the Variety of Random
Documents with Different Content
“You are the noblest man in the world!”
A quick spasm crossed his face in the darkness. Noble! Yet how little
popular esteem seemed to him at that moment! He went on
hurriedly, for what he had to say must be in few words:
“Always—whatever happens—you will remember what I have said,
Teresa?”
Whatever happens! She threw her arms about his neck, mute with
the anguish that was fighting with her resolution.
“—that you are all to me. That I love you—you only; that I shall love
you to the end.”
“If I forgot that, I could not live!” she said chokingly.
The great clock struck ponderously from the palace hall—a
clamorous reminder that he must hasten, for the night was almost
without a star, and a wreathing nebulous mist forbade rapid riding.
Through all his preparations this hour had reared as the last harbor-
light of home. It had come and gone like a breath on glass. In the still
night the chime sounded like a far spired bell. Some banal freak of
memory brought to Gordon’s mind the old church dial jutting over
Fleet Street in London, and the wooden wild men which had struck
the hour with their clubs as he issued from John Murray’s shop the
night of his maiden speech in Parliament.
The strokes counted twelve—midnight. She shuddered as he rose to
his feet.
“My love—my life!” he said, and clasped her close.
“God keep you!” she breathed.
He left her and went a few steps into the darkness. She thought him
gone. But he came back swiftly, his hands groping.
He heard a shuddering sob tear its way from her heart, but she stood
motionless in his arms, her cheek grown suddenly cold against his
own.
In that moment a strange feeling had come to her that they clasped
each other now for the last time. It was as though an icy hand were
pressed upon her heart, stilling its pulsations.
She felt his arms again release her and knew she was alone.
It lacked an hour of day when Gordon rode into Leghorn, and the
first streak of dawn strove vainly to shred the curdled mist as he
stepped from a lighter aboard the Hercules. The tide was at full and
a rising breeze flapped the canvas.
Standing apart on her deck, his mind abstracted, though his ears
were humming with the profane noises of creaking cordage,
windlass and capstan, he felt as if the fall of the headsman’s ax had
divided his soul in two. He saw his past rolled up like a useless
palimpsest in the giant hand of destiny—his future an unvexed scroll
laid waiting for mystic characters yet unformed and unimagined.
Beneath the bitterness of parting, be felt, strangely enough, a kind of
peace wider than he had ever known. The hatred that tracked, the
Nemesis that had harassed, he left behind him.
Absorbed in his reflections, he did not hear the bawled orders of the
ship’s mate, nor the spitting crackle of musketry from some ship’s
hulk near-by in the foggy smother. The brig was lifting and pushing
as she gained headway. The captain spoke at his elbow.
“Begging your lordship’s pardon, a man has just come aboard by the
ship’s bow-chains. He had a tough swim for it and a bullet through
the forearm. Says he was shanghaied by the Pylades. If we put
about, we’ll lose the tide. What are your lordship’s orders?”
“Is he Italian?”
“No, sir. He says he’s an Englishman, but he looks Lascar.”
“His name?” the demand fell sharply.
“Trevanion, your lordship.”
As Gordon stood there, breathing deeply, Teresa, at home in her
room, stretched at the foot of the crucifix, was crying in a voice of
anguish, that icy hand still pressed upon her heart: “O God! help me
to remember that it is for Greece! and for himself most of all! Help
me not to forget—not to forget!”
For only an instant Gordon hesitated. “Let him stay,” he said then to
the captain, and turned away to his cabin.
CHAPTER LVII
THE MAN IN THE RED UNIFORM
From a vessel lying beyond the shallows that stretched three miles
from the Greek shore, a puff of smoke broke balloon-like, to be
followed, a moment after, by a muffled report.
The crowds of people clustered along the town’s front cheered wildly.
Every day for weeks they had been watching: blue-eyed, dusky
Albanians, with horse-hair capotes and pistoled girdles; supple
lighter complexioned Greeks in the national kirtle; Suliotes, whose
mountain wildnesses were reflected in their dress; and a
miscellaneous mixture of citizens of every rank and age.
For this vessel bore the coming savior of the Grecian nation, the
great English peer whose songs for years had been sung in their
own Romaic tongue, whose coming had been prated of so long by
their primates—he who should make them victorious against the
Turk. Was it not he who, in Cephalonia, on his way hither, had fed
from his own purse the flying refugees from Scio and Patras, and
sent them back with arms in their hands? Was he not the friend of
their own Prince Mavrocordato, who in this same stronghold of
Missolonghi had fought off Omer Pasha with his twenty thousand
troops, and now controlled the provisional government of Western
Greece? Was it not he who had sent two hundred thousand piastres
to outfit the fleet before whose approach Yussuff Pasha’s squadron
had withdrawn sullenly to Lepanto?
They had known of Gordon’s departure from Cephalonia from the
forty Mariotes he sent ahead to be his own body-guard, and who
strutted it about the fortifications, boasting of the distinction. His
consort vessel had arrived, after narrowly escaping capture. His own
brig, chased by the Turks, had been driven on the rocky coast. This
they had learned from a surly Arab-like Englishman, his arm in a
sling from an unhealed bullet-wound, who had been in the vessel
and had found a footsore way overland.
The metropolitan had called a special service in the church for his
lordship’s deliverance. Now his ship, escaping rocks and the enemy,
had anchored safely in the night, and the roar of salutes from the
Speziot brigs-of-war that lay in the harbor had waked the sleeping
port. Since daylight the shore had been a moving mass, sprinkled
with brilliant figures: soldiery of fortune, wearing the uniform of well-
nigh every European nation.
There was one who watched that pushing, staring multitude who did
not rejoice. As he listened to the tumult of gladness, Trevanion’s
heart was a fiery furnace. His hatred, fostered so long, was the “be-
all and end-all” of his moody existence, and the benefit Gordon had
conferred when he delivered him from Cassidy’s marines, had
become at length insupportable. With a perversion of reasoning
characteristically Asiatic, he had chosen to wipe it from the slate and
make the favor naught. He went to Leghorn and to the amaze of
Cassidy, surrendered himself to the Pylades.
This voluntary act, perhaps, made vigilance lighter. He watched his
chance, leaped overboard in the foggy morning, and would have got
safe to shore but for one well-aimed musket. Chance put the
departing brig in his way. He had been delirious in the forecastle for
days from his wound, and knowledge of Gordon’s presence and
mission had not come to him till the Grecian shore was in sight.
In his durance on the Pylades his hair and beard had grown; he
fancied himself unrecognized. Hour by hour, watching Gordon
covertly, seeing him living and sleeping on deck in all weathers,
eating the coarse fare and enduring every privation of his sailors,
Trevanion’s blood inflamed itself still more. He owed the other
nothing now! He raged within himself at the celebrity the expedition
and its leader acquired at Cephalonia. In the pursuit of Gordon’s
vessel by the Turks he had hoped for its capture. When she ran
upon the rocks he deemed this certain, and forsook her jubilantly. He
had no fear of making his way afoot to Missolonghi; strangely
enough, years before, during the Feast of Ramazan, he had fled
over this same path to escape a Mohammedan vengeance, and
pursued by the memory of a Greek girl abandoned to the last
dreadful penalty because of him—a memory that haunted him still.
To-day, as Trevanion saw the vessel that held his enemy, his eyes
gleamed with a sinister regard.
“Bah!” sneered a voice behind him in the Romaic tongue. “An
English noble! Who says so? Mavrocordato. There are those who
say he is a Turk in disguise who will sell the country to the sultan.”
The man who had spoken wore the dress of a chieftain of lower
rank. His comrade answered with an oath:
“Or to the English. Kalon malubdi! Give me a chief like Ulysses! In
six months he would have gained the whole Peloponnesus, but for
the coming of this foreigner—may a good ball find him!”
To Trevanion the malediction was as grateful as a draft of cool beer
to the scorched palate of a waking sot. He spoke in the vernacular:
“There are English, too, who would drink that toast! Who is
Ulysses?”
His faded sailor’s rig had been misleading. Both clapped hands to
their belts as, “One who will sweep this puppet of Mavrocordato’s
into the gulf!” the first replied fiercely.
“May I be there to help!” exclaimed Trevanion, savagely. “Take me to
this leader of yours!”
The two Suliotes looked at him narrowly, then conferred. At length
the chief came closer.
“If you would serve Ulysses,” he said, “meet me beyond the north
fortifications at sunset.”
Trevanion nodded, and they turned away, as a shout went up from
the assembled people. A boat had swung out from the brig’s davits.
It carried a flag—a white cross on a blue ground—the standard of
New Greece.
The man with the disabled arm flushed suddenly, for his dark, sullen
gaze had fallen on the sea-wall, where stood His Highness, Prince
Mavrocordato, with Pietro Gamba. The latter had followed Gordon to
Cephalonia and from there had come on the Hercules’ consort. A
slinking shame bit Trevanion as he recalled the day when his
poisoned whisper would have fired that young heart to murder; he
wheeled and plunged into the human surge.
The couple on the sea-wall watched eagerly. The lowered boat had
been rapidly manned. A figure wearing a scarlet uniform took its
place in the stern-sheets. The crowd buzzed and dilated.
The prince lowered his field-glass. “Thank God, he is safe!” he
exclaimed in earnest Italian. “We have been in desperate straits,
Pietro. With the General Assembly preparing to meet, when all the
western country is in such disorder, with these untamed mountain
chiefs flocking here with their clans, with Botzaris killed in battle, and
only my paltry five thousand to keep dissensions in check, I have
been prepared for the worst. Now there is hope. Look!”
He stretched his hand toward the teeming quay. “They have waited
for him as for the Messiah. All the chiefs, except Ulysses, who has
always plotted for control—and his spies are in the town at this
moment!—will defer to him. With a united front what could Greece
not do! The Turk could never enslave her again. With no supreme
head, her provinces are like the untied bundle of sticks—easily
broken one at a time!”
They watched in silence while the rowers drew nearer across the
shallows.
“I did not hope to see you here, Pietro,” Mavrocordato said
affectionately, as they started toward headquarters.
Gamba answered simply: “She sent me—to guard him if I could.”
Ten minutes more and the boat was at the landing.
The instant its bow touched the masonry before line of picked troops,
a single bell rang out from the Greek church. Other iron tongues took
it up. The walls shook with rolling salvos of artillery, the firing of
muskets and wild music, as the man in the scarlet uniform, colorless
and strangely composed amid the tossing agitation, stepped on
shore to grasp the hand of Prince Mavrocordato, standing with a
long suite of European and Greek officers.
As his gaze swept over the massed soldiery, the frantic people, the
women on roofs and balconies, the houses hung with waving
carpets,—a rainbow motley of color,—a great shout rolled along the
embankments, a tumult mingled with hand-clapping like a silver rain,
that drowned all words. Women in the multitude sobbed, and on the
balconies little children were held up in stronger arms to see their
deliverer. Every eye was on that central figure, with face like the
Apollo Belvedere and a step that halted as if with fatigue, but with a
look clear and luminous and the shadow of a smile moulding his lips.
“Panayeia keep him!” sobbed a weeping woman, and threw herself
between the lines of soldiers to kiss the tassel of his sword.
The metropolitan, his robes trailing the ground, lifted before him a
silver eikon glittering in the sun.
The soldiers presented arms.
The bells broke forth again, and amid their jubilant ringing the wearer
of the red uniform passed slowly, with Prince Mavrocordato by his
side, into the stone building which rose above the quay—the military
headquarters of the revolutionary forces of Western Greece.
CHAPTER LVIII
THE ARCHISTRATEGOS
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
textbookfull.com