100% found this document useful (1 vote)
14 views

Beginning PHP and MySQL: From Novice to Professional 5th Edition Frank M. Kromann pdf download

The document is about the 5th edition of 'Beginning PHP and MySQL' by Frank M. Kromann, which covers the latest enhancements in PHP 7 and updates in MySQL. It provides a comprehensive guide on installing, configuring, and utilizing PHP and MySQL for web development, along with practical examples and best practices. The book also includes various chapters on advanced topics such as object-oriented programming, error handling, and secure programming techniques.

Uploaded by

pombokoughzt
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
14 views

Beginning PHP and MySQL: From Novice to Professional 5th Edition Frank M. Kromann pdf download

The document is about the 5th edition of 'Beginning PHP and MySQL' by Frank M. Kromann, which covers the latest enhancements in PHP 7 and updates in MySQL. It provides a comprehensive guide on installing, configuring, and utilizing PHP and MySQL for web development, along with practical examples and best practices. The book also includes various chapters on advanced topics such as object-oriented programming, error handling, and secure programming techniques.

Uploaded by

pombokoughzt
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 60

Beginning PHP and MySQL: From Novice to

Professional 5th Edition Frank M. Kromann


download

https://textbookfull.com/product/beginning-php-and-mysql-from-
novice-to-professional-5th-edition-frank-m-kromann/

Download more ebook from https://textbookfull.com


We believe these products will be a great fit for you. Click
the link to download now, or visit textbookfull.com
to discover even more!

Beginning Rust: From Novice to Professional Carlo


Milanesi

https://textbookfull.com/product/beginning-rust-from-novice-to-
professional-carlo-milanesi/

Beginning Python: From Novice to Professional Magnus


Lie Hetland

https://textbookfull.com/product/beginning-python-from-novice-to-
professional-magnus-lie-hetland/

Beginning Rails 6: From Novice to Professional Brady


Somerville

https://textbookfull.com/product/beginning-rails-6-from-novice-
to-professional-brady-somerville/

Beginning SQL Queries From Novice to Professional Clare


Churcher

https://textbookfull.com/product/beginning-sql-queries-from-
novice-to-professional-clare-churcher/
Beginning Rust: From Novice to Professional 1st Edition
Carlo Milanesi

https://textbookfull.com/product/beginning-rust-from-novice-to-
professional-1st-edition-carlo-milanesi/

Beginning Spring 5: From Novice to Professional Joseph


B. Ottinger

https://textbookfull.com/product/beginning-spring-5-from-novice-
to-professional-joseph-b-ottinger/

Beginning Perl Programming: From Novice to Professional


William "Bo" Rothwell

https://textbookfull.com/product/beginning-perl-programming-from-
novice-to-professional-william-bo-rothwell/

Beginning Python: From Novice to Professional, 3rd


Edition Magnus Lie Hetland

https://textbookfull.com/product/beginning-python-from-novice-to-
professional-3rd-edition-magnus-lie-hetland/

Beginning Rails 6: From Novice to Professional 4th


Edition Brady Somerville

https://textbookfull.com/product/beginning-rails-6-from-novice-
to-professional-4th-edition-brady-somerville/
Frank M. Kromann

Beginning PHP and MySQL


From Novice to Professional
5th ed.
Frank M. Kromann
Aliso Viejo, CA, USA

Any source code or other supplementary material referenced by the


author in this book is available to readers on GitHub via the book’s
product page, located at www.​apress.​com/​9781430260431 . For more
detailed information, please visit http://​www.​apress.​com/​source-code
.

ISBN 978-1-4302-6043-1 e-ISBN 978-1-4302-6044-8


https://doi.org/10.1007/978-1-4302-6044-8

Library of Congress Control Number: 2018964569

© Frank M. Kromann 2018

This work is subject to copyright. All rights are reserved by the


Publisher, whether the whole or part of the material is concerned,
specifically the rights of translation, reprinting, reuse of illustrations,
recitation, broadcasting, reproduction on microfilms or in any other
physical way, and transmission or information storage and retrieval,
electronic adaptation, computer software, or by similar or dissimilar
methodology now known or hereafter developed.

Trademarked names, logos, and images may appear in this book. Rather
than use a trademark symbol with every occurrence of a trademarked
name, logo, or image we use the names, logos, and images only in an
editorial fashion and to the benefit of the trademark owner, with no
intention of infringement of the trademark. The use in this publication
of trade names, trademarks, service marks, and similar terms, even if
they are not identified as such, is not to be taken as an expression of
opinion as to whether or not they are subject to proprietary rights.
While the advice and information in this book are believed to be true
and accurate at the date of publication, neither the authors nor the
editors nor the publisher can accept any legal responsibility for any
errors or omissions that may be made. The publisher makes no
warranty, express or implied, with respect to the material contained
herein.

Distributed to the book trade worldwide by Springer Science+Business


Media New York, 233 Spring Street, 6th Floor, New York, NY 10013.
Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail orders-
ny@springer-sbm.com, or visit www.springeronline.com. Apress Media,
LLC is a California LLC and the sole member (owner) is Springer
Science + Business Media Finance Inc (SSBM Finance Inc). SSBM
Finance Inc is a Delaware corporation.
Introduction
This marks the fifth edition of Beginning PHP and MySQL . This revision
focuses on the new additions to PHP and new versions of MySQL. Since
the last revision, PHP released version 7 with many language
enhancements and improvements to performance, in some cases more
than twice as fast and using less than half the memory compared to
PHP 5.6. During the writing of this book, version 7.0, 7.1, and 7.2 was
released; and before the ink on this book is dry, PHP 7.3 will be
released.
The MySQL database has also seen many changes. First of all, the
acquisition by Oracle and subsequent release of Maria DB, a fork of the
MySQL version with both performance and feature improvements and a
fast-growing community, has taken the new version to heart. It is, in
fact, the standard MySQL database on many Linux distributions today.
This book will teach you to install and configure PHP and MySQL
with both performance and security in mind and highlight some of the
new functionality available in PHP 7 as well as new data types
supported by the current version of MySQL.
Table of Contents
Chapter 1:​Introducing PHP
Key PHP Features
Practicality
Power
Possibility
Price
The Current State of PHP
The PHP Ecosystem
Drupal
WordPress
Magento
MediaWiki
SugarCRM
Zend Framework
Summary
Chapter 2:​Configuring Your Environment
Choosing a Hosting Environment
Virtual Servers
Platform as a Service (PaaS)
Installation Prerequisites
Windows
macOS
Linux
From Source
Configure PHP
The Apache httpd.​conf and .​htaccess Files
Within the Executing Script
PHP’s Configuration Directives
Choosing an Editor
PHPStorm
Atom
Sublime Text
Visual Studio Code
PDT (PHP Development Tools)
Zend Studio
Summary
Chapter 3:​PHP Basics
Embedding PHP Code in Your Web Pages
Default Syntax
ShortTags
Embedding Multiple Code Blocks
Commenting Your Code
Single-Line C++ Syntax
Multiple-Line Comments
Outputting Data to the Client
Complex Output Using the printf() Statement
The sprintf() Statement
PHP’s Data Types
Scalar Data Types
Compound Data Types
Converting Between Data Types Using Type Casting
Adapting Data Types with Type Juggling
Type Identifier Functions
Manipulating Dynamic Data Using Variables
Variable Declaration
PHP’s Superglobal Variables
Managing Constant Data with Constants
Defining a Constant
Taking Action with Expressions
Defining Inputs with Operands
Defining Actions with Operators
String Interpolation
Double Quotes
Escape Sequences
Single Quotes
Curly Braces
Heredoc
Nowdoc
Taking Control with Control Structures
Making Decisions with Conditional Statements
Iterating Repeatedly with Looping Statements
File-Inclusion Statements
Summary
Chapter 4:​Functions
Invoking a Function
Creating a Function
Returning Multiple Values
Passing Arguments by Value
Default Argument Values
Using Type Declarations
Recursive Functions
Anonymous Functions
Function Libraries
Summary
Chapter 5:​Arrays
What Is an Array?​
Creating an Array
Creating Arrays with array()
Extracting Arrays with list()
Populating Arrays with a Predefined Value Range
Testing for an Array
Outputting an Array
Printing Arrays for Testing Purposes
Adding and Removing Array Elements
Adding a Value to the Front of an Array
Adding a Value to the End of an Array
Removing a Value from the Front of an Array
Removing a Value from the End of an Array
Locating Array Elements
Searching an Array
Retrieving Array Keys
Retrieving Array Values
Extracting Columns
Traversing Arrays
Retrieving the Current Array Key
Retrieving the Current Array Value
Moving the Array Pointer
Passing Array Values to a Function
Determining Array Size and Uniqueness
Determining the Size of an Array
Counting Array Value Frequency
Determining Unique Array Values
Sorting Arrays
Reversing Array Element Order
Flipping Array Keys and Values
Sorting an Array
Merging, Slicing, Splicing, and Dissecting Arrays
Merging Arrays
Recursively Appending Arrays
Combining Two Arrays
Slicing an Array
Splicing an Array
Calculating an Array Intersection
Calculating Associative Array Intersections
Calculating Array Differences
Calculating Associative Array Differences
Other Useful Array Functions
Returning a Random Set of Keys
Shuffling Array Elements
Summary
Chapter 6:​Object-Oriented PHP
The Benefits of OOP
Encapsulation
Inheritance
Polymorphism
Key OOP Concepts
Classes
Objects
Properties
Constants
Methods
Constructors and Destructors
Constructors
Destructors
Static Class Members
The instanceof Keyword
Helper Functions
Determining Whether a Class Exists
Determining Object Context
Learning About Class Methods
Learning About Class Properties
Learning About Declared Classes
Learning About Object Properties
Determining an Object’s Parent Class
Determining Object Type
Determining Object Subclass Type
Determining Method Existence
Autoloading Objects
Traits
Summary
Chapter 7:​Advanced OOP Features
Advanced OOP Features Not Supported by PHP
Object Cloning
Cloning Example
The _​_​clone() Method
Inheritance
Class Inheritance
Inheritance and Constructors
Inheritance and Late Static Binding
Interfaces
Implementing a Single Interface
Implementing Multiple Interfaces
Abstract Classes
Introducing Namespaces
Summary
Chapter 8:​Error and Exception Handling
All Your Bugs Belong to You
Configuring PHP’s Error Reporting Behavior
Setting the Desired Error Sensitivity Level
Displaying Errors Within the Browser
Logging Errors
Creating and Logging Custom Messages
Exception Handling
Why Exception Handling Is Handy
PHP’s Exception-Handling Capabilities
Extending the Base Exception Class
The Default Constructor
Introducing the Finally Block
Extending the Exception Class
Catching Multiple Exceptions
Standard PHP Library Exceptions
Error Handling in PHP 7
Summary
Chapter 9:​Strings and Regular Expressions
Regular Expressions
Regular Expression Syntax (Perl)
Other String-Specific Functions
Determining the Length of a String
Comparing Two Strings
Manipulating String Case
Converting Strings to and from HTML
Alternatives for Regular Expression Functions
Tokenizing a String Based on Predefined Characters
Exploding a String Based on a Predefined Delimiter
Converting an Array into a String
Performing Complex String Parsing
Finding the Last Occurrence of a String
Replacing All Instances of a String with Another String
Retrieving Part of a String
Returning Part of a String Based on Predefined Offsets
Determining the Frequency of a String’s Appearance
Replacing a Portion of a String with Another String
Padding and Stripping a String
Counting Characters and Words
Summary
Chapter 10:​Working with the File and Operating System
Learning About Files and Directories
Directory Separators
Parsing Directory Paths
Calculating File, Directory, and Disk Sizes
Determining Access and Modification Times
Working with Files
The Concept of a Resource
Recognizing Newline Characters
Recognizing the End-of-File Character
Opening and Closing a File
Reading from a File
Writing a String to a File
Tip Moving the File Pointer
Reading Directory Contents
Executing Shell Commands
Removing a Directory
Renaming a File
Touching a File
System-Level Program Execution
Sanitizing the Input
PHP’s Program Execution Functions
Summary
Chapter 11:​Third-Party Libraries
Introducing PEAR
Installing PEAR
Updating PEAR
Using the PEAR Package Manager
Installing a PEAR Package
Automatically Installing All Dependencies
Viewing Installed PEAR Packages
Introducing Composer
Installing Composer
Using Composer
Extending PHP with C Libraries
Summary
Chapter 12:​Date and Time
The Unix Timestamp
PHP’s Date and Time Library
Validating Dates
Formatting Dates and Times
Converting a Timestamp to User-Friendly Values
Working with Timestamps
Date Fu
Displaying the Localized Date and Time
Displaying the Web Page’s Most Recent Modification Date
Determining the Number of Days in the Current Month
Determining the Number of Days in Any Given Month
Calculating the Date X Days from the Present Date
Date and Time Classes
Introducing the DateTime Constructor
Formatting Dates
Setting the Date After Instantiation
Setting the Time After Instantiation
Modifying Dates and Times
Calculating the Difference Between Two Dates
Summary
Chapter 13:​Forms
PHP and Web Forms
A Simple Example
Validating Form Data
File Deletion
Cross-Site Scripting
Sanitizing User Input
Validating and Sanitizing Data with the Filter Extension
Working with Multivalued Form Components
Summary
Chapter 14:​Authenticating Your Users
HTTP Authentication Concepts
Using Apache’s .​htaccess Feature
Authenticating Your Users with PHP
PHP’s Authentication Variables
Useful Functions
Hard-Coded Authentication
File-Based Authentication
Database-Based Authentication
User Login Administration
Password Hashing
One-Time URLs and Password Recovery
Using OAuth 2.​0
Summary
Chapter 15:​Handling File Uploads
Uploading Files via HTTP
Uploading Files with PHP
PHP’s File Upload/​Resource Directives
The $_​FILES Array
PHP’s File-Upload Functions
Upload Error Messages
A Simple Example
Summary
Chapter 16:​Networking
DNS, Services, and Servers
DNS
Services
Establishing Socket Connections
Mail
Configuration Directives
Sending E-mail Using a PHP Script
Common Networking Tasks
Pinging a Server
Creating a Port Scanner
Creating a Subnet Converter
Summary
Chapter 17:​Session Handlers
What Is Session Handling?​
The Session-Handling Process
Configuration Directives
Managing the Session Storage Media
Setting the Session Files Path
Automatically Enabling Sessions
Setting the Session Name
Choosing Cookies or URL Rewriting
Setting the Session Cookie Lifetime
Setting the Session Cookie’s Valid URL Path
Setting Caching Directions
Working with Sessions
Starting a Session
Destroying a Session
Setting and Retrieving the Session ID
Creating and Deleting Session Variables
Encoding and Decoding Session Data
Practical Session-Handling Examples
Automatically Logging In Returning Users
Generating a Recently Viewed Document Index
Creating Custom Session Handlers
Tying Custom Session Functions into PHP’s Logic
Using Custom MySQL-Based Session Handlers
Summary
Chapter 18:​Web Services
Why Web Services?​
Getting Started with APIs
API Security
Create an API
Summary
Chapter 19:​Secure PHP Programming
Configuring PHP Securely
Security-Related Configuration Parameters
Hiding Configuration Details
Hiding Apache
Hiding PHP
Hiding Sensitive Data
Hiding the Document Root
Denying Access to Certain File Extensions
Data Encryption
PHP’s Encryption Functions
Encrypting Data Using OpenSSL
Summary
Chapter 20:​Integrating jQuery and PHP
Introducing Ajax
Introducing jQuery
Installing jQuery
A Simple Example
Responding to Events
jQuery and the DOM
Creating a Username Existence Validator
Determining If a Username Exists
Summary
Chapter 21:​MVC and Frameworks
Introducing MVC
PHP’s Framework Solutions
The CakePHP Framework
The Symfony Framework
The Zend Framework
The Phalcon Framework
The Laravel Framework
The PHP Framework Interoperability​Group (PHP-FIG)
PSR-1 and PSR-2 Coding Standards
PSR-4 Autoloading
Summary
Chapter 22:​Introducing MySQL
What Makes MySQL So Popular?​
Flexibility
Power
Flexible Licensing Options
Prominent MySQL Users
Craigslist
Twitter
GitHub
Other Prominent Users
MariaDB:​An Alternative to MySQL
Summary
Chapter 23:​Installing and Configuring MySQL
Downloading MySQL
Installing MySQL
Installing MySQL on Linux
Installing and Configuring MySQL on Windows
Starting and Stopping MySQL
Controlling the Daemon Manually
Configuring and Optimizing MySQL
The mysqld_​safe Wrapper
MySQL’s Configuration and Optimization Parameters
The my.​cnf File
Configuring PHP to Work with MySQL
Reconfiguring PHP on Linux
Reconfiguring PHP on Windows
Summary
Chapter 24:​The Many MySQL Clients
Introducing the Command-Line Clients
The mysql Client
The mysqladmin Client
Other Useful Clients
Useful GUI Client Programs
phpMyAdmin
Summary
Chapter 25:​MySQL Storage Engines and Data Types
Storage Engines
InnoDB
MyISAM
MEMORY
MERGE
FEDERATED
ARCHIVE
CSV
EXAMPLE
BLACKHOLE
Storage Engine FAQ
Data Types and Attributes
Data Types
Data Type Attributes
Working with Databases and Tables
Working with Databases
Working with Tables
Altering a Table Structure
The INFORMATION_​SCHEMA
Summary
Chapter 26:​Securing MySQL
What You Should Do First
Securing the mysqld Daemon
The MySQL Access Privilege System
How the Privilege System Works
Where Is Access Information Stored?​
User and Privilege Management
Creating Users
Deleting Users
Renaming Users
The Grant and Revoke Commands
Reviewing Privileges
Limiting User Resources
Secure MySQL Connections
Grant Options
SSL Options
Starting the SSL-Enabled MySQL Server
Connecting Using an SSL-Enabled Client
Storing SSL Options in the my.​cnf File
Summary
Chapter 27:​Using PHP with MySQL
Installation Prerequisites
Enabling the mysqli Extension on Linux/​Unix
Enabling the mysqli Extension on Windows
Using the MySQL Native Driver
Managing User Privileges
Working with Sample Data
Using the mysqli Extension
Setting Up and Tearing Down the Connection
Handling Connection Errors
Retrieving Error Information
Storing Connection Information in a Separate File
Securing Your Connection Information
Interacting with the Database
Sending a Query to the Database
Parsing Query Results
Determining the Rows Selected and Rows Affected
Working with Prepared Statements
Executing Database Transactions
Enabling Autocommit Mode
Committing a Transaction
Rolling Back a Transaction
Summary
Chapter 28:​Introducing PDO
Another Database Abstraction Layer?​
PDO’s Database Options
Using PDO
Installing PDO
Connecting to a Database Server and Selecting a Database
Handling Errors
Getting and Setting Attributes
Executing Queries
Introducing Prepared Statements
Retrieving Data
Setting Bound Columns
Working with Transactions
Summary
Chapter 29:​Stored Routines
Should You Use Stored Routines?​
Stored Routine Advantages
Stored Routine Disadvantages
How MySQL Implements Stored Routines
Creating a Stored Routine
Declaring and Setting Variables
Executing a Stored Routine
Creating and Using Multistatement Stored Routines
Calling a Routine from Within Another Routine
Modifying a Stored Routine
Deleting a Stored Routine
Viewing a Routine’s Status
Viewing a Routine’s Creation Syntax
Handling Conditions
Integrating Routines into Web Applications
Creating the Employee Bonus Interface
Retrieving Multiple Rows
Summary
Chapter 30:​MySQL Triggers
Introducing Triggers
Why Use Triggers?​
Taking Action Before an Event
Taking Action After an Event
Before Triggers vs.​After Triggers
MySQL’s Trigger Support
Creating a Trigger
Viewing Existing Triggers
Modifying a Trigger
Deleting a Trigger
Integrating Triggers into Web Applications
Summary
Chapter 31:​MySQL Views
Introducing Views
MySQL’s View Support
Creating and Executing Views
Viewing View Information
Modifying a View
Deleting a View
Updating Views
Incorporating Views into Web Applications
Summary
Chapter 32:​Practical Database Queries
Sample Data
Creating Tabular Output
Installing HTML_​Table
Creating a Simple Table
Creating More Readable Row Output
Creating a Table from Database Data
Sorting Output
Creating Paged Output
Listing Page Numbers
Querying Multiple Tables with Subqueries
Performing Comparisons with Subqueries
Determining Existence with Subqueries
Performing Database Maintenance with Subqueries
Using Subqueries with PHP
Iterating Result Sets with Cursors
Cursor Basics
Creating a Cursor
Opening a Cursor
Using a Cursor
Closing a Cursor
Using Cursors with PHP
Summary
Chapter 33:​Indexes and Searching
Database Indexing
Primary Key Indexes
Unique Indexes
Normal Indexes
Full-Text Indexes
Indexing Best Practices
Forms-Based Searches
Performing a Simple Search
Extending Search Capabilities
Performing a Full-Text Search
Summary
Chapter 34:​Transactions
What’s a Transaction?​
MySQL’s Transactional Capabilities
System Requirements
Table Creation
A Sample Project
Creating Tables and Adding Sample Data
Executing an Example Transaction
Usage Tips
Building Transactional Applications with PHP
The Swap Meet Revisited
Summary
Chapter 35:​Importing and Exporting Data
Sample Table
Using Data Delimitation
Importing Data
Importing Data with LOAD DATA INFILE
Importing Data with mysqlimport
Loading Table Data with PHP
Exporting Data
SELECT INTO OUTFILE
Summary
Index
Other documents randomly have
different content
The Project Gutenberg eBook of Under the
Star-Spangled Banner: A Tale of the Spanish-
American War
This ebook is for the use of anyone anywhere in the United States
and most other parts of the world at no cost and with almost no
restrictions whatsoever. You may copy it, give it away or re-use it
under the terms of the Project Gutenberg License included with this
ebook or online at www.gutenberg.org. If you are not located in the
United States, you will have to check the laws of the country where
you are located before using this eBook.

Title: Under the Star-Spangled Banner: A Tale of the Spanish-


American War

Author: F. S. Brereton

Release date: November 21, 2012 [eBook #41425]


Most recently updated: October 23, 2024

Language: English

Credits: Produced by Juliet Sutherland, Mary Meehan and the Online


Distributed Proofreading Team at http://www.pgdp.net

*** START OF THE PROJECT GUTENBERG EBOOK UNDER THE


STAR-SPANGLED BANNER: A TALE OF THE SPANISH-AMERICAN
WAR ***
UNDER THE STAR-SPANGLED
BANNER
A Tale of the Spanish-American War
BY CAPTAIN F. S. BRERETON,
R.A.M.C.
AUTHOR OF "WITH RIFLE AND BAYONET,"
"THE DRAGON OF PEKIN," "A GALLANT
GRENADIER," ETC., ETC.
NEW YORK
STITT PUBLISHING COMPANY
1905
"THE BOWS OF THE MAINE WERE CRUSHED
INTO SHAPELESS WRECKAGE."
CONTENTS
CHAPTER PAGE
I. The Marchant Foundry 1
II. "Face Troubles Like a Man" 9
III. An Eventful Voyage 18
IV. A Call for Volunteers 27
V. No Rest for the Weary 38
VI. A Friend in Need 47
VII. All But Killed 56
VIII. The Loss of the "Maine" 68
IX. "The Ever-faithful Island" 82
X. A Sudden Attack 94
XI. A Bold Course 111
XII. A Risky Undertaking 128
XIII. In Danger and Distress 146
XIV. A Dash for Liberty 163
XV. With the American Fleet 178
XVI. The Beginning of Hostilities 195
XVII. A Baptism of Fire 209
XVIII. A Desperate Undertaking 226
XIX. Fortune Favors the Brave 245
XX. The Invasion of Cuba 260
XXI. Nearing the End 278
XXII. The Flower of the Hacienda 295
UNDER THE STAR-SPANGLED
BANNER
CHAPTER I
THE MARCHANT FOUNDRY
The city of Birmingham was wrapped in a mantle of fog so dense
that the inhabitants found it difficult to move about. The thick, soot-
laden atmosphere covered everything, and only a few faintly
glimmering lights showed that they really existed.
The clock in the church tower had just struck two, and yet the street
lamps were ablaze.
The pedestrians moved with the utmost care. Trudging along the
soppy pavements, their footsteps sounded hollow and unreal, and
were heard long before they themselves put in an appearance.
One of the inhabitants, however, contrived to find his way with
comparative ease, for he was such an old resident that his feet
would not go astray, however absent-minded their owner happened
to be. There was a certain air of authority about him; yet there was
that about the stern, calm features that denoted a warm heart and a
kindly disposition. But still, as if the fog was not in existence, he
hurried on, turning from the main street to the lower part of the
town.
Ordinarily he could never accomplish this walk without meeting
many an acquaintance, for Mr. Thomas Marchant was a well-known
man. He was one of the magnates of this busy town, a wealthy
employer of labor, and it was to the work his foundries gave that
many of the inhabitants owed their prosperity.
Mr. Marchant was troubled; for only a year ago he was one of the
wealthiest men in the city. His foundries were working night and day,
and even then could hardly keep pace with the orders.
"I've never known such a rush," he said to his manager when
discussing the matter. "It gives me great satisfaction, for our men
will benefit by the increased orders as well as ourselves."
That was a short year ago, and now there was a different tale to tell.
True, the iron foundry was still in full swing, but cotton mills, which
Mr. Marchant owned in addition, were losing money every day, and
in those few months he had been ruined; and he knew that the
world would know him and speak of him as a bankrupt, while his
possessions would be seized upon by the creditors.
The Marchant iron-works were in full swing. As Mr. Marchant
entered, a mass of sputtering iron was dragged by a powerful man,
dressed in rough trousers and thin vest, and protected by an apron
of leather. Another dark and perspiring figure came to his aid, and
the weight was dropped onto a small trolley, on which it was run to
the big steam hammer standing near at hand.
Mr. Marchant watched them a moment, and then walked to his
office, in which a somewhat untidily dressed gentleman was sitting.
"Good-day, Mr.Tomkins," he said.
"Good-afternoon, sir," Mr. Tomkins, who was the manager of the
foundry, responded. Then, in a doubtful manner, he said, "There
have been some visitors to see you this morning, and I told them to
come again. One was Steinkirk."
"Does Hal know? Has he been told?" Mr. Marchant asked abruptly.
"No one has liked to break the news to him yet, sir. We weren't
certain, and we hoped that things would turn out all right. I suppose
it's hopeless now, sir?"
"Absolutely!" Mr. Marchant replied. "I am irretrievably ruined. The
mills are gone, and to obtain money when the times were bad, I had
to mortgage these works. I have nothing left. But I have seen to one
matter; if trouble has come upon me, there is no reason why it
should swamp all whom I employ. The creditor will carry on the
work, and you and all the others will remain as at present. Poor Hal!
He is the one who will suffer, more even than his father. He is a
beggar!" He sank his face into his hands and groaned.
"It's not so bad as that, sir," said Mr. Tomkins. "Hal's got plenty of
spirit, and if there's no money, why, he'll put his shoulder to the
wheel. You should see how he works here. He's in the casting-shed,
and to look at him any day you'd think he had his bread to earn."
"Which he has from this moment," Mr. Marchant exclaimed. "You do
me good, Tomkins. When I was a lad I had nothing. I had literally to
slave for years, and to deny myself many a long day. Then fortune
came with a rush which almost overwhelmed me. It has gone almost
more quickly, and I must learn to make the best of my troubles. As
for Hal, I think you are right. Let us go across and see him."
They left the office and entered a shed in which a number of men
were at work. In a corner one of them was ramming a plug of clay
into the orifice of a furnace, and was replacing the lining of similar
material which protected the trough down which the molten metal
was destined to run. At the end of the trough was an enormous
bucket, suspended from a crane, which traveled backwards and
forwards overhead.
The remainder of the shed was occupied with castings, or rather,
with molds in various stages of preparation. Here and there were
artisans at work, and amongst them, kneeling on the sand which
covered the floor, was a youth who might well be taken for the son
of a foundry hand. He was between seventeen and eighteen years of
age, and of more than medium height. Dressed in a pair of rough
trousers and a flannel shirt, he was to the casual observer merely an
ordinary employee. But there was a certain something about this
young fellow that made him different from the others at work in the
shed. There was a grace about his figure, while his features were
more refined than those commonly met with amongst the working
classes.
This was the son of the owner, and he was known to all at the
foundry as Hal Marchant.
It was delicate work upon which he was engaged. With a special tool
he was smoothing down the mold, carefully rounding off corners,
building up a portion here which had broken down. Finally he sat up,
and, surveying the work with an air of satisfaction, exclaimed:
"That's finished, and I think it'll do. Now I'll get the foreman to pass
it, and then we'll see it cast. Hallo! The guv', as I live! Why, you
made me jump. What do you think of that?"
"Very good, old boy," Mr. Marchant replied. "You are an adept at the
trade. What says the foreman?"
"He knows what he's up to, he does," the latter remarked. "Another
week or so of this work and he'll be fit to boss the shed."
"Ah, that's satisfactory," said Mr. Marchant. "But I've something to
say to you, Hal, so come to the office."
He turned and walked from the shed, taking no notice of the friendly
glances his workmen threw in his direction.
"What can be wrong with the guv'?" he asked, looking after Mr.
Marchant, and then at the manager. "What is it, Tomkins? Tell me."
For a moment the manager of the works wavered, uncertain
whether to tell the truth.
"After all, he's got to know, sooner or later," he murmured.
"Something's wrong, Hal," he continued. "There's no use in beating
about the bush any longer. My only surprise is that you haven't seen
for yourself that things were completely upset. I suppose every
workman here knows what is going on, and it seems strange that
they haven't dropped you a hint. The fact is, the foundry is broken,
and the owner has lost every penny he possessed. He's ruined, and
the works go to a creditor."
"Ruined! Part with the works! Why, we are full of orders, and by all
accounts are in the most thriving condition!"
"Just so, Hal, that's the bitter pill about this matter. The cotton mills
up Preston way have broken. For two years they have been working
at a dead loss. Your father mortgaged the mills, hoping to tide over
bad times. But instead of improving they became even worse. Then
the foundry had to go to raise the money. The folks who advanced
the money have claimed it, and your father is unable to pay; so the
long and short of it is that he no longer owns these works; and, to
put it bluntly, he has scarcely a sixpence left, and both he and you
must work for a living."
Hal attempted to stutter out some answer, but a big lump rose in his
throat, making him almost choke. And yet, had it been possible to
read his thoughts at this trying time, there would have been found
nothing selfish about them, for the question as to what was to
become of himself had not crossed his mind. No; only the deepest
sympathy with his father was felt, for they were the very best of
friends.
"I can scarcely believe all you tell me," Hal said at length. "What will
father do? It is a terrible blow for him."
"It's bad, and there's no denying that," Mr. Tomkins replied. "But
come along and hear what the guv' has to say."
Hal followed the manager to the office and seated himself at the
desk beside which his father had taken a place. They looked at each
other in the most painful silence. Then Hal stretched out his hand
and took his father's.
"I'm sorry, dad," he said. "I've heard all now, and only wish that I
could help you."
"There is no help; nothing can mend what has happened," answered
Mr. Marchant, in despondent tones. "I have lost everything, and now
that you know, I only wish to discuss what is to happen to you.
What will you do for a living? For myself, I shall probably remain to
conduct the business for the new owner, and, of course, if you wish
it, you may also stay."
"It is a difficult question to answer, dad," said Hal. "For the present,
at any rate, I shall remain where I am, as if nothing had occurred.
Perhaps later on, it will be better for me to go elsewhere."
"I think you are right. Stay where you are for a while, and later I will
contrive to get a good post for you. There are reasons why I do not
wish you to stay at the foundry longer than can be helped. Now I
will go, for I have other matters to attend to."
"Good-by, dad. Don't be too downhearted," said Hal cheerfully.
"Remember what you were when you were my age, and you will see
that there is no reason why matters should not improve."
"Young men do not feel so acutely as the middle-aged," Mr.
Marchant replied. "Nor do the latter set their faces against adversity
as easily as they did in their earlier days."
He smiled half tearfully, and, waving his hand, went out into the
dense fog.
"It's a bad business—a cruel affair altogether," said Mr. Tomkins, at
length. "If the failure had been of his own doing, one might not have
felt the same for him. But I know that he has been the most
cautious and far-seeing of owners, and his mills have been patterns
of well-ordered establishments. But now it is all finished with."
"One moment," exclaimed Hal. "Why should I leave the foundry?"
"Ah, I thought you'd want to know," the manager answered. "The
fact is we are now the servants of a hard-fisted fellow. The
gentleman who advanced the money sold the mortgage, and the
buyer has a very evil reputation. It is because of this that your father
advises you to quit. Moses Steinkirk is the fellow who has bought us
up, and I fear we shall all have an uncomfortable time of it. Now
we'll go back to the casting-pit. That wheel's got to be finished."
Quitting the office, they struck across the yard and entered the
shed, to find that the mold upon which Hal had been engaged was
completed.
"All ready for the metal, sir," said the foreman.
"The top cover of Mr. Hal's wheel was slung on a few minutes ago,
and it will be as good a job as we ever put out. What do yer say,
sir?"
"I don't know that it will be as good as the castings usually turned
out from here," Hal replied. "Still, I hope it will do us credit."
"That it will, sir. Joe finished it up when you and the guv' cleared off,
and he said as it was the best he'd seen for many a day."
"Jack, boy, you can let her go," sang out the foreman at this
moment.
"Right yer are," was the gruff answer. "Now then, all of yer, bring the
bucket closer, and mind yer toes."
Grasping a long iron rod, he thrust it into the lump of clay which
closed the orifice of the furnace, and which was by this baked
almost as hard as stone. A second later a jet of white-hot fluid
poured out with a gurgle, and, emitting showers of sparks, rushed in
a broad stream into the bucket.
"She's full. Up with her, boys!" cried the foreman.
At once the big crane creaked, and hoisting up the bucket, swung it
towards the mold. Meanwhile two of the men had grasped the
handles, and drawing the bucket to the orifice, tipped it. The fiery
stream disappeared into the depths of the mold. Then it began to
well up in the opening, and a moment or two later the empty bucket
was whisked away.
"That's finished, so far. Now, Tom, up yer get, and see that she cools
as she ought to," cried Mason.
Tom, the man he had beckoned to, stepped onto the framework,
and, taking a rod, commenced to ram it into the opening through
which the metal had been poured.
"That's finished, and we may as well go," said Tomkins. "It will take
five hours for that to cool. Come along, Hal. Good-night to you,
Mason."
"Good-night, sir. Good-night, Mr. Hal."
The words came from all parts of the shed, and replying to them
cheerfully, Hal repaired to the office with the manager.
CHAPTER II
"FACE TROUBLES LIKE A MAN"
Seen in the glare of the furnace flames as he emerged from the
foundry, Hal Marchant was a very different individual from the
workman who had been so diligent in the casting-pit.
Then he had been much like his fellows—just a roughly clad artisan,
covered with sand, and with hands and face streaked with soot and
dirt. Now that he was ready to go into the town, however, he was a
spruce and dapper young gentleman. He had the manners of his
father, and though not a prig, nor less given to mirth than others of
his age, he was a very respectable and creditable member of society.
But Hal was genuinely grieved about his father, and as he walked
home, his thoughts were busy wondering what he would do, and
how he could possibly extricate himself from his difficulties.
"Surely this man will allow father to work off the debt," he
murmured. "I know for a matter of fact that we have numerous
orders, and must be making money. Why, then, should he not be
allowed to remain? It might take a few years to work off the
amount, but it would be done."
But Hal did not know the world very well. If he had he would have
realized that this was a business transaction, and that when the
creditor had a power over the profits of the foundry, and particularly
one with such a reputation, he was not likely to forego his claims.
"We must just make the best of a bad matter," Hal at length
remarked. "I'll do my utmost to help, and all I make shall go to the
funds to keep up the house."
He turned into the gates of the big mansion and, mounting the
steps, opened the door with a latch-key. He paused on the threshold
to listen, but there was not a sound in the house.
"Strange!" he murmured. "The guv' said he was returning at once,
and these last few weeks one has usually known immediately
whether he was at home by hearing his steps as he paced up and
down the floor of his room. That was what first gave me an idea that
something was wrong. But perhaps he is in, and has fallen asleep in
his chair, as I have often known him to do."
Hal walked across the fine hall, and opening the door on the left,
looked into an apartment which was evidently library and smoking
room in one. He put his head through the doorway and inspected
the apartment. But there was no sign of his father, and he was about
to withdraw when a faint groan fell upon his ear. In an instant he
darted in, and discovered a figure huddled in a chair in a dark
portion of the room. It was Mr. Marchant.
Hal sprang to his side and looked eagerly in his face, but there was
no sign of recognition, for the eyes were closed. He placed his hand
on the wrist and felt for a pulse without success. Then the truth
dawned upon him—slowly at first, and then with a whirl, and with all
its cruel force.
"Dead!" he gasped. "Father dead!"
There was no doubt about it, and Hal had to face the matter. Once
more he felt for a pulse, and then he went to the bell and pressed
the button.
"Send for the doctor at once, please," he said when the servant
arrived. "I am afraid that my father is dead."
"Dead, sir? Dead!" the girl exclaimed in a whisper.
"Yes, that is the case," Hal answered. "Send for Dr. Harding."
Five minutes later the doctor arrived. He pronounced life extinct. "A
stroke," he said. "He died painlessly and swiftly. May we all do the
same, for it is a merciful ending. But tell me, Hal, was there cause?
Was there any sudden shock that you know of?"
"Yes; there was a great one," Hal answered slowly. "Father was
ruined. To-morrow he would have been in the position of his
manager, instead of the employer of hundreds of hands."
"Then he has had a merciful escape," said the doctor. "The blow was
a heavy one, and the life to follow would have been extremely hard.
And what of yourself, my boy?"
"I, too, have lost all my prospects," Hal answered steadily. "But I am
hardly more than a boy. The world is before me, and I will make my
way in it. This house will be sold, I suppose, and if all the debts
cannot be met, someone will have to wait. It shall be my business to
work, make money, and clear my father's name."
"A resolution to be proud of. Face troubles like a man, and half the
battle is already won," exclaimed the doctor. "But I hope that when
all is sold no debts will remain. Then you will be free to rise solely on
your own account."
He pressed Hal's hand and left the house.
A week passed and found Hal in lodgings in the town, for Mr.
Marchant's house had been sold, and, to Hal's relief, it was
ascertained that not a penny was owing to any man.
"Now for myself," he said as he sat over the fire. "What to do is the
question."
There was a knock at the door, and Mr. Tomkins put his head into
the room. "Hallo!" he said. "Do you feel inclined for a chat?"
"Yes; come in. I'm wondering what to do with myself."
"And so am I," was the answer. "That is, I'm wondering what would
be good for you. How about the foundry? Will you stick to it?"
"On no account," Hal replied. "I could not bear to go there now. In
fact, I mean to leave Birmingham, for it would bring back these last
few days every time I passed the old home. I must work, and pay
my way, for at present I possess fifteen pounds and a few suits of
clothes; that is all."
"I thought you'd not go back to the works," said Mr. Tomkins. "I've
been there boy and man these twenty years, and I've risen to be
manager. But I am leaving with my old master, for I cannot fancy the
new. I'm lucky, too, for I've accepted the post of manager to another
foundry in the north. Come along with me, and I'll see that you get
something good."
Hal thanked him, and thought the matter over before answering.
"I scarcely know what to say," he said. "But I am determined to
leave Birmingham. I couldn't stand it."
"It would be rough, I own," Mr. Tomkins said. "But what about
coming north?"
"It is very good of you to suggest it, Tomkins," Hal answered, "but,
before deciding, there is something that I should like to know about.
Of course, I am not very well up in trade affairs, but I do happen to
know that the Americans are very go-ahead in the matter of iron-
works. They undertake bridge-building to a great extent, and I
thought that it might be worth my while to cross the water. I
certainly ought to get a job. They pay well out in America, Tomkins.
What do you say to the plan?"
"Those Yanks are hard at work," he said. "They are go-ahead
people, as you say, and there's no doubt that they can show us a
thing or two in the way of bridges. Yes, anything to do with iron and
engineering is booming across the Atlantic, and there must be lots of
openings for youngsters. There's something else besides. In good
old England we're overcrowded, but in America there's a demand for
chaps who know a little above the ordinary. I should say it would be
a good thing, Hal, and if you decide upon it, the traveling there, and
the new life, will rouse you a bit, and help you to forget present
troubles."
"You think well of it," said Hal. "Then I shall go to America and try
my luck. I may as well start as soon as possible, and I wish very
particularly to do so, for while in this city I run the chance of
meeting old friends. Besides, if I went to see any of them, they
might think that I was looking for help, and I want to make a place
for myself."
"And quite right too. Independence is the thing," the manager cried,
patting him on the back. "Now, look here, youngster, are you willing
to rough it from the very commencement? If so, I can help you get
to America."
"Quite," Hal answered promptly.
"Then come along with me to the office of a shipping firm I know.
They've carried many a time for the foundry, and I've only to drop
the manager a hint that you are wanting to get across at the
cheapest rate possible, and I'll be bound he'll arrange."
"I've no cousins or relatives of any sort," he said, "and I've come to
the conclusion that this is the best thing I can do."
"That's good! I'm certain you are doing what is right," Mr. Tomkins
answered.
They went into the street, and within a few minutes were at the
shipping office.
"Good-day, Mr. Tomkins. What can we do for you this time?" asked
the clerk.
"A good deal, if you care. Can we come in behind? I want to speak
to you about my young friend here."
"To be sure," the clerk replied. "Step in. Now, what is it?" he asked.
"I recognize your companion. He is the son of the late Mr.
Marchant."
"Quite so; and he wishes to go abroad to America, to make his way
in the world. Can you do anything for him in the way of a cheap
passage?"
"He could go for nothing, or rather, could earn a pound and food
besides the berth. But he'd have to rough it."
"I'm ready for that, any day; in fact, I'd like to start right away," Hal
said, eagerly.
"Then I may as well tell you that there is a vacancy for a greaser
aboard the Mohican. Will you take that? There! A passage, your
grub, and a pound at the end of the trip."
"You can put my name down for it," said Hal. "I'll go on the
Mohican; and I thank you for your kindness."
"Not at all; it's nothing after the freights we got from your father's
foundry. Good-day, sir; good-day, Tomkins. Excuse me, but I'm very
busy." The clerk nodded in a friendly way, and departed.
"I put that down as a good omen," said Tomkins as they emerged
into the street. "You're in luck, Hal, for right from the
commencement you get what you want. The rest will come just the
same, let us hope. Now I'll leave you, as I have matters to attend
to."
He shook Hal's hand and walked up the street.
Hal returned to his rooms, and hunted out his belongings. It was
getting dark as he went into the street with a bundle over his
shoulder. He entered a shop which he had noticed on former
occasions, wondering what class of people patronized it.
"How much for these?" he asked, opening his bundle, and displaying
five suits which he had been in the habit of wearing in Birmingham.
"They're not much good to me," he said. "They're not the class o'
togs I want. Six shillings the lot."
"Six shillings!" said Hal quietly. "They cost four times as many
pounds, and that quite recently. Bid again."
"Six the figure. Not a penny more," exclaimed the man.
"I'll take four pounds for the lot," said Hal.
"You may, but not from me, young man. Good a'ternoon to yer."
"Good-day; I'll go elsewhere," said Hal quietly, and at once did up
the fastenings of his bundle. Then he lifted it, and walked calmly out
of the shop.
"Hold hard there!" cried the man, arresting him at the door. "Let's
see the togs again." He inspected them closely; but it was merely a
pretense, for anyone could see with half an eye that they were really
good. "I'll make it three ten," he said.
"Very well, you can have them," Hal replied, glad to get so good a
price.
Next day he was told that the Mohican would sail on Saturday.
"She's one of the intermediate boats," said the clerk. "Of course, she
carries very few passengers—some thirty in all. You'd better be
aboard on Friday, for she leaves the river early the following day.
Good luck to you."
"And many thanks to you," Hal answered. "I'll do my best to fill the
place you have obtained for me."
Hal took a cheap ticket to Liverpool, and trudged from the station to
the dock in which the Mohican was lying.
Hal picked his way to the wide and slippery gangway, and began to
cross it. A notice above an alleyway caught his eye. "Engineers only,"
it said.
He entered the alleyway, and walked along it till he came to a door
on the left, where he knocked.
"Who's there? Come right in," someone cried in a sleepy voice.
Hal entered, and found a big man reclining full length on the settee.
He was dressed in an old uniform, and had a handkerchief tied
round his neck.
"Wall, what aer it?" he asked. "A feller can't no more get ter sleep
upon this hulk than fly. Who aer yer?"
He sat up and surveyed Hal sleepily.
"I'm sorry I roused you. I'm the new hand—the greaser," said Hal.
"Oh, you're the greaser! Wall, yer aint the sort as ships aboard the
Mohican every time. What aer it? Rows with the boss? High jinks at
home? Broke; aint that it?"
"Not quite, but nearly," Hal answered with a smile. "I'm working my
passage."
"So; then you've come to right ship ter do it. But you'd better get to
your quarters; there, along the alleyway. So long, young 'un, and
when yer want a bit of a help, come along to me. I'm Old Yank, the
boss of the engine-room."
Closing the door, Hal went along the alleyway till he came to a large
cabin, above which was painted "Greasers." No one was in, but one
of the bunks had evidently not been appropriated.
"That will do for me," thought Hal. "I'll put my bundle here, and then
have a look round."
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

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.

Let us accompany you on the journey of exploring knowledge and


personal growth!

textbookfull.com

You might also like