100% found this document useful (3 votes)
32 views

PHP and MySQL Create Modify Reuse 1st Edition Timothy Boronczyk 2024 Scribd Download

Boronczyk

Uploaded by

ranearhonelf
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (3 votes)
32 views

PHP and MySQL Create Modify Reuse 1st Edition Timothy Boronczyk 2024 Scribd Download

Boronczyk

Uploaded by

ranearhonelf
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 50

Download the full version of the ebook at ebookname.

com

PHP and MySQL Create Modify Reuse 1st Edition


Timothy Boronczyk

https://ebookname.com/product/php-and-mysql-create-modify-
reuse-1st-edition-timothy-boronczyk/

OR CLICK BUTTON

DOWNLOAD EBOOK

Download more ebook instantly today at https://ebookname.com


Instant digital products (PDF, ePub, MOBI) available
Download now and explore formats that suit you...

Expert PHP and MySQL 1st Edition Andrew Curioso

https://ebookname.com/product/expert-php-and-mysql-1st-edition-andrew-
curioso/

ebookname.com

Learning PHP MySQL JavaScript 4th Edition Robin Nixon

https://ebookname.com/product/learning-php-mysql-javascript-4th-
edition-robin-nixon/

ebookname.com

PHP and MySQL for Dummies 2nd ed Edition Janet Valade

https://ebookname.com/product/php-and-mysql-for-dummies-2nd-ed-
edition-janet-valade/

ebookname.com

The Queer Aesthetics of Childhood Asymmetries of Innocence


and the Cultural Politics of Child Development Hannah Dyer

https://ebookname.com/product/the-queer-aesthetics-of-childhood-
asymmetries-of-innocence-and-the-cultural-politics-of-child-
development-hannah-dyer/
ebookname.com
Molecular Mechanisms in Hypertension 1st Edition Richard
N. Re

https://ebookname.com/product/molecular-mechanisms-in-
hypertension-1st-edition-richard-n-re/

ebookname.com

Emerson for the Twenty First Century 1st Edition Barry


Tharaud

https://ebookname.com/product/emerson-for-the-twenty-first-
century-1st-edition-barry-tharaud/

ebookname.com

Musicians as Lifelong Learners 1st Edition Rineke Smilde

https://ebookname.com/product/musicians-as-lifelong-learners-1st-
edition-rineke-smilde/

ebookname.com

Frommer s Norway 2005 Frommer s Complete 2nd Edition


Darwin Porter

https://ebookname.com/product/frommer-s-norway-2005-frommer-s-
complete-2nd-edition-darwin-porter/

ebookname.com

Expedition and Wilderness Medicine Gregory H. Bledsoe

https://ebookname.com/product/expedition-and-wilderness-medicine-
gregory-h-bledsoe/

ebookname.com
101 Great Science Experiments Neil Ardley

https://ebookname.com/product/101-great-science-experiments-neil-
ardley/

ebookname.com
PHP and MySQL®
Create-Modify-Reuse

Tim Boronczyk
with
Martin E. Psinas

Wiley Publishing, Inc.

ffirs.indd iii 3/29/08 11:30:13 AM


ffirs.indd ii 3/29/08 11:30:13 AM
PHP and MySQL®
Create-Modify-Reuse

Introduction ........................................................................................................... xi

Chapter 1: User Registration...........................................................................1


Chapter 2: Community Forum ........................................................................31
Chapter 3: Mailing List .................................................................................63
Chapter 4: Search Engine .............................................................................87
Chapter 5: Personal Calendar......................................................................113
Chapter 6: Ajax File Manager......................................................................137
Chapter 7: Online Photo Album ...................................................................177
Chapter 8: Shopping Cart ...........................................................................195
Chapter 9: Web Site Statistics ....................................................................239
Chapter 10: News/Blog System ..................................................................265
Chapter 11: Shell Scripts ............................................................................291
Chapter 12: Security and Logging ...............................................................315

Index .........................................................................................................333

ffirs.indd i 3/29/08 11:30:12 AM


ffirs.indd ii 3/29/08 11:30:13 AM
PHP and MySQL®
Create-Modify-Reuse

Tim Boronczyk
with
Martin E. Psinas

Wiley Publishing, Inc.

ffirs.indd iii 3/29/08 11:30:13 AM


PHP and MySQL®: Create-Modify-Reuse
Published by
Wiley Publishing, Inc.
10475 Crosspoint Boulevard
Indianapolis, IN 46256
www.wiley.com
Copyright © 2008 by Wiley Publishing, Inc., Indianapolis, Indiana
Published simultaneously in Canada
ISBN: 978-0-470-19242-9
Manufactured in the United States of America
10 9 8 7 6 5 4 3 2 1
Library of Congress Cataloging-in-Publication Data
Boronczyk, Tim, 1979-
PHP and MySQL : create-modify-reuse / Tim Boronczyk with Martin E. Psinas.
p. cm.
Includes index.
ISBN 978-0-470-19242-9 (paper/website)
1. MySQL (Electronic resource) 2. PHP (Computer program language) 3. Web sites—Design.
I. Psinas, Martin E. II. Title.
QA76.73.P224B64 2008
006.7'6—dc22
2008011996

No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by
any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted
under Sections 107 or 108 of the 1976 United States Copyright Act, without either the prior written
permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the
Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600.
Requests to the Publisher for permission should be addressed to the Legal Department, Wiley Publishing,
Inc., 10475 Crosspoint Blvd., Indianapolis, IN 46256, (317) 572-3447, fax (317) 572-4355, or online at
http://www.wiley.com/go/permissions.
Limit of Liability/Disclaimer of Warranty: The publisher and the author make no representations or war-
ranties with respect to the accuracy or completeness of the contents of this work and specifically disclaim all
warranties, including without limitation warranties of fitness for a particular purpose. No warranty may be
created or extended by sales or promotional materials. The advice and strategies contained herein may not
be suitable for every situation. This work is sold with the understanding that the publisher is not engaged in
rendering legal, accounting, or other professional services. If professional assistance is required, the services
of a competent professional person should be sought. Neither the publisher nor the author shall be liable for
damages arising herefrom. The fact that an organization or Website is referred to in this work as a citation
and/or a potential source of further information does not mean that the author or the publisher endorses the
information the organization or Website may provide or recommendations it may make. Further, readers
should be aware that Internet Websites listed in this work may have changed or disappeared between when
this work was written and when it is read.
For general information on our other products and services please contact our Customer Care Department
within the United States at (800) 762-2974, outside the United States at (317) 572-3993 or fax (317) 572-4002.
Trademarks: Wiley, the Wiley logo, Wrox, the Wrox logo, Wrox Programmer to Programmer, and related
trade dress are trademarks or registered trademarks of John Wiley & Sons, Inc. and/or its affiliates, in
the United States and other countries, and may not be used without written permission. MySQL is a
registered trademark of MySQL AB. All other trademarks are the property of their respective owners.
Wiley Publishing, Inc. is not associated with any product or vendor mentioned in this book.
Wiley also publishes its books in a variety of electronic formats. Some content that appears in print may not
be available in electronic books.

ffirs.indd iv 3/29/08 11:30:13 AM


About the Author
Timothy Boronczyk is a native of Syracuse, NY, where he works as a freelance developer, programmer
and technical editor. He has been involved in web design since 1998 and over the years has written
several articles and tutorials on PHP programming. Timothy holds a degree in software application
programming and recently started his first business venture, Salt City Tech (www.saltcitytech.com).
In his spare time, he enjoys photography, hanging out with friends, and sleeping with his feet hanging
off the end of his bed. He’s easily distracted by shiny objects.

About the Contributor


Martin E. Psinas is a recognized security expert and valued member of the open-source community.
He has been contracted as a technical editor, code auditor, and is a published author with Pearson
Education as well as the #1 PHP magazine, PHP|Architect. In his free time, he maintains his personal
web site and is a volunteer administrator/contributor at codewalkers.com — a resource for
PHP & MySQL developers. Martin interacts frequently with the leaders of the PHP project as well as
PHP User ’s Groups.

ffirs.indd v 3/29/08 11:30:14 AM


Credits
Acquisitions Editor Production Manager
Jenny Watson Tim Tate

Development Editor Vice President and Executive Group Publisher


Ed Connor Richard Swadley

Technical Editor Vice President and Executive Publisher


Graham Christensen Joseph B. Wikert

Production Editor Project Coordinator, Cover


Daniel Scribner Lynsey Stanford

Copy Editor Proofreader


Michael Koch Corina Copp

Editorial Manager Indexer


Mary Beth Wakefield Ron Strauss

vi

ffirs.indd vi 3/29/08 11:30:14 AM


Contents

Introduction xi

Chapter 1: User Registration 1


Plan the Directory Layout 1
Planning the Database 2
Writing Shared Code 3
User Class 5
CAPTCHA 9
Templates 11
Registering a New User 12
E-mailing a Validation Link 17
Logging In and Out 21
Changing Information 25
Forgotten Passwords 28
Summary 30

Chapter 2: Community Forum 31


Design of the Forum 31
Designing the Database 32
Working with Permissions and Bitwise Operators 33
Updating the User Class 35
Code and Code Explanation 40
Adding Forums 41
Adding Posts 43
Displaying Forums and Posts 47
Pagination 55
Avatars 56
BBCode 59
Summary 62

Chapter 3: Mailing List 63


Design of the Mailing List 63
Choosing POP3 64

ftoc.indd vii 3/29/08 11:31:29 AM


Contents
Designing the Database 65
Code and Code Explanation 66
The POP3 Client 66
The Configuration File 73
Account Management 73
Processing Messages 79
Processing the Digest 83
Setting Up the Mailing List 83
Summary 86

Chapter 4: Search Engine 87


Designing the Search Engine 87
Problems with Full-Text Search 88
Designing the Database 89
Code and Code Explanation 91
Administrative Interface 91
Crawler/Indexer 98
Front End 104
Summary 110

Chapter 5: Personal Calendar 113


Designing the Application 113
Designing the Database 114
Code and Code Explanation 115
Creating a Month-View Calendar 115
Creating a Day-View Calendar 120
Adding and Showing Events 121
Sending Reminders 129
Exporting the Calendar 130
Summary 135

Chapter 6: Ajax File Manager 137


Design of the Ajax File Manager 137
JavaScript and Ajax 138
The XMLHttpRequest Object 139
Code and Code Explanation 142
Main Interface 143
Client-Side Functionality 147
Server-Side Functionality 160
Summary 175

viii

ftoc.indd viii 3/29/08 11:31:29 AM


Contents

Chapter 7: Online Photo Album 177


Design of the Online Photo Album 177
Code and Code Explanation 178
Views 178
Helper Files 188
QuickTime Thumbnails 190
Thumbnail Caching 192
Summary 193

Chapter 8: Shopping Cart 195


Designing the Shopping Cart 195
Designing the Database 196
Code and Code Explanation 197
The ShoppingCart Class 197
Working with the Shopping Cart 201
Building the Storefront 209
Adding Inventory 217
Summary 238

Chapter 9: Web Site Statistics 239


Determining What to Collect 239
Designing the Database 241
Obtaining Data 242
Code and Code Explanation 244
Pie Chart 244
Bar Chart 248
The Report 253
Summary 264

Chapter 10: News/Blog System 265


Tables 265
Adding Posts 267
Generating the RSS 278
Displaying Posts 282
Adding Comments 285
Summary 289

ix

ftoc.indd ix 3/29/08 11:31:30 AM


Contents

Chapter 11: Shell Scripts 291


Designing the Script 292
General Shell Scripting Advice 293
Code and Code Explanation 294
The CommandLine Class 294
startproject 303
The Skeleton 313
Summary 314

Chapter 12: Security and Logging 315


Cross-Site Scripting 315
Path Traversal 318
Injection 320
SQL Injection 320
Command Injection 324
Weak Authentication 325
Logging 327
Preventing Accidental Deletes 330
Summary 332

Index 333

ftoc.indd x 3/29/08 11:31:30 AM


Introduction

I’m especially amazed at how the Internet has grown and evolved over the past decade or so. It has
grown from a collection of static text documents connected by a few hyperlinks to a platform for
delivering rich, distributed applications. And when it comes time to develop these web-based
applications, many programmers are choosing PHP and MySQL.

In this book, I present basic code for 12 PHP-powered projects that you can use and extend however you
wish. I have tried to write them so the code can be easily reused in future applications, but in some
instances the entire application can be reused as well!

I’ve enjoyed the opportunity to write and share with you this information and I hope you have just as
much fun reading it and learning from it. More importantly, I hope you find good, practical uses for the
projects found within this book.

Who This Book Is For


I present basic yet functional projects for you to implement and extend in any way you see fit. That very
fact assumes you know the fundamentals of programming in PHP and general web development. This
book is not a textbook. Still, you do not need to be an advanced PHP programmer to gain much by
reading it. New programmers should find this book helpful as it will give them guidance in how to
program different applications. The 12 projects may even serve to ignite their curiosity and spur them to
write 12 more projects of their own. Intermediate and more experienced programmers will find this book
helpful because they are able to take the projects I present, modify them and apply them to their
real-world needs.

Some projects build upon previous projects, so while you don’t have to read the book from cover to
cover, I do suggest reading all relevant chapters (or at least the pertinent sections) regardless of your
skill level. For example, in Chapter 7, I present an online photo album, but pictures are uploaded using
the AJAX file manager presented in Chapter 6. Both projects are laid out in the manner presented in
Chapter 1.

What This Book Covers


The code in this book was written for MySQL 5.0 Community Server and PHP version 5.2.5,
so essentially I am covering those releases or greater. Additional modification may be necessary if you
plan on using earlier releases.

flast.indd xi 3/29/08 11:30:52 AM


Introduction

How This Book Is Structured


Each chapter is organized so following projects can build upon earlier projects. Here’s a brief rundown
of what you can look forward to in the following chapters:

Chapter 1: User Registration


Create a basic user registration system
Reusable components: configuration/include files, 401.php, User class

Chapter 2: Community Forum


Expand on user registration system to create a community forum with user privileges
and threaded posts
Reusable components: JpegThumbnail class, BBCode class

Chapter 3: Mailing List


Create a mailing list with control address and digest mailings
Reusable components: POP3Client class

Chapter 4: Search Engine


Build a custom search engine for your own site
Reusable components: entire application

Chapter 5: Personal Calendar


Write a personal calendar utility to keep yourself organized
Reusable components: entire application

Chapter 6: AJAX File Manager


Create an AJAX-ified file upload and directory viewer
Reusable components: entire application (this project introduces AJAX which will be used in
subsequent projects)

Chapter 7: Online Photo Album


Create a file-based image gallery with automatically generated thumbnails that supports JPEG and
QuickTime formats.
Reusable components: MovThumbnail class

Chapter 8: Shopping Cart


Write a categorized shopping cart
Reusable components: ShoppingCart class

Chapter 9: Web Site Statistics


Log site traffic and collect information about site visitors to make better business decisions
Reusable components: PieChart class, BarChart class

Chapter 10: News/Blog system


Build a news or blog system with comments and RSS feed
Reusable components: entire application (project also introduces reusable components such as YUI
calendar and TinyMCE rich text control)

xii

flast.indd xii 3/29/08 11:30:53 AM


Exploring the Variety of Random
Documents with Different Content
passage thence to London in ninety-one days.[214] This has never
been surpassed, except by the Sir Lancelot, which in the same year
made the passage to London in ninety days[216] (her owner states
eighty-nine days). Indeed, so completely have we outstripped the
United States and all other nations, that instead of American clippers
bringing teas from China to supply the London market, English
clippers are frequently engaged to load the early teas from China to
New York.[217]
Nor have other trades than that of China been very far behind in this
great ocean race. Many of the sailing vessels now engaged in the
trade with Australia and India are remarkable for their swiftness and
increased capacity, combined with greatly reduced sailing expenses.
Superior in speed to any of the ships of the old East India Company,
they have double the space for cargo in proportion to their register
tonnage, and are manned and navigated by about one-third the
number of men. Among them and the China clippers are to be found
some of the handsomest vessels the world has ever seen. Marvellous
specimens of grace and beauty, not surpassed even by the finest
yachts, and much easier in their movements, when under full sail
and at their greatest speed, than any “thing of beauty” yet produced
in either Great Britain or the United States for the purposes of ocean
navigation.
But however great have been the strides in the
Equal increase improvement of the merchant vessels of Great
in the number Britain, their rapid increase in number since the
as well as
repeal of the Navigation Laws has been equally
excellence of
English astonishing; while the freedom of our laws has
shipping. given an impetus to maritime commerce far
beyond the most sanguine hopes of those who, a
Results of the
quarter of a century ago, most strenuously
Free-trade advocated the policy of Free-trade. That my
policy. readers may see how we stand, so far as our ships
are concerned, in comparison with other nations, I
have had a table prepared, which will be found in the Appendix,[218]
showing the progress they have made as compared with other
countries, before and after the repeal of our Navigation Laws. The
figures are remarkable; and, though it is not the province of this
work to enter upon controversial questions, I cannot refrain from
directing the attention of my readers to the fact that the nations
which have adopted a liberal policy have made much the greatest
advance; while the United States of America, to which I have so
frequently referred, have, with all their natural advantages,
materially retrograded as a maritime people. Nor have continental
nations, like France, to which I shall presently refer, made any
progress worthy of note under the ancient commercial policy, to
which they still, in a large measure, and most unwisely, adhere.

FOOTNOTES:
[195] An Address of Shipowners to the Electors of the United Kingdom, 13th April,
1859.
[196] I had served my constituents, I thought, well and faithfully for two
Parliaments. I had fought to obtain reciprocity from foreign nations, before we
repealed our Navigation Laws, the only time when we could have had any hope of
obtaining it unless the statesmen of other nations became as enlightened as our
own; and, having been defeated, I was then doing my utmost to assist in
obtaining for them from our own Legislature, relief from the unjust and oppressive
burdens with which they had been saddled during a period of protection;
consequently, I could not but feel keenly the determined opposition which they,
the Shipowners—men of my own class—for whom I had worked so strenuously,
had organised against my return to Parliament.
[197] The numbers were, Fenwick, 1527; Lindsay, 1292; Hudson, 790. The contest
was between Mr. Hudson and myself; but, though Mr. Hudson, better known as
the “Railway King” during the fleeting days of his transitory power, was a strong
Conservative, he had done so much for Sunderland through the railways which he
brought into the town, and the magnificent docks constructed entirely through his
influence, that I felt regret, at having been the instrument of his political expulsion
from the representation of a port, where he had rendered such marked and
valuable services. But I fear it is too true, that popular constituencies are
sometimes as inconsistent as they are fickle. Henry Fenwick, whom Sunderland on
that occasion, and deservedly so, returned at the head of the poll, and who was
one of the best of members and the manliest of men, soon afterwards lost his
seat, because the Government of the day, appreciating his many good qualities,
had appointed him the Civil Lord of the Admiralty.
[198] When Mr. Dunbar died four or six years afterwards, he left behind him
somewhere close upon one million and a half pounds sterling, the larger portion of
which was made since the Free-trade sun had been allowed to shine upon his
ships!
[199] “Had I,” continued Mr. Lindsay, “remained a silent spectator at this meeting
as I intended, I should have been an assenting party to a resolution which asks us
to reverse our policy. (‘No, no!’) But such would have been the case, for the
resolution says, ‘that the principal cause of the depression has been the impolicy
of the existing system of maritime commerce.’ I hold that the establishment of a
Free-trade policy has nothing whatever to do with the existing depression in the
shipping interest (cries of ‘Oh, oh!’ and great disapprobation), and therefore I
come forward and offer my dissent. This resolution, further, asks us to confirm a
memorial which the Shipowners’ Society of London, this time last year, addressed
to her Majesty. I, for one, cannot be a consenting party to that resolution or
memorial, because I believe that the opinions therein expressed are fallacious, and
I shall endeavour to show you how. What is the prayer of that memorial? It
urgently entreats, indeed implores her Majesty to issue an Order in Council against
those nations which have not reciprocated with us. (‘Bravo!’ and cheers.) I am in
favour of reciprocity—it is Free-trade in its most extended sense—but I ask you to
look at the difference between reciprocity and the enforcement of reciprocity by
the Legislature. Enforced reciprocity, as prayed for by you in this memorial, is
Protection in its worst and most pernicious form. (Cries of ‘Shame,’ and hisses.) It
is a renewal of the old war of tariffs; therefore, it is the war of Protection. (Great
uproar.) We must not retrograde, our course is onward.” (Hisses and uproar.)
Mr. G. F. Young: I rise to order. (Cheers, and a few cries of “No, no!”) Sir, I will not
so far depart from the usages of debate as to introduce a speech on rising to
order, but will submit that the course of discussion is irregular and unfair. I have
challenged the hon. member to discuss this particular point with me publicly. He
has declined my challenge. (Great cheering.)
The Chairman: I think that my friend Mr. Young in calling my hon. friend Mr. Lindsay
to order has rather himself travelled a little out of order. (“Hear, hear!” and a
laugh.) I cannot think that Mr. Lindsay is out of order; but it will rest with the
meeting to decide whether or not they will hear Mr. Lindsay in continuation.
(“Hear, hear!” and disapprobation.)
Mr. Lindsay: Gentlemen, remember that we are in the city of London, and that the
eyes of England are upon us. We are assembled to discuss a question of deep
interest to its maritime interests, viz., what is the best course for the nation to
pursue in the first place.
Mr. Young: No, no; to inquire what should be done. (“Hear, hear!”)
Mr. Lindsay: Well, then, I suppose it is to discuss this, that we have come here.
Now, I say, we have to inquire what is the best policy to be pursued for the nation
at large (cheers); and, secondly, for ourselves as shipowners. (Cheers.) The
question before us is this, whether the reversal of our Free-trade policy will be
best for the interest of the country at large. (“Hear, hear!” hisses and confusion.)
Mr. G. F. Young: The Legislature will inquire into that. (“Hear, hear!”)
Mr. Lindsay: I say this resolution goes to the root of Free-trade, and confirms the
memorial sent by you last year to the Queen. (Cheers.) Now, then, in reply to that
memorial—and bear in mind that you received that reply from a Protectionist
Government, my Lord Derby’s through whom you made this appeal. (“Hear,”
cheers, hisses, and cries of “Question, question!”) I am speaking to the question.
Now, the answer given to your memorial by the Board of Trade clearly and
distinctly proved that under a Free-trade policy the British shipping had increased
in a far greater ratio than it ever did under a Protectionist policy. (“Hear, hear!”
and a cry, “Prove it!”) It has been proved, and let those deny it who can, that from
1842 to 1849 British shipping built and registered during the period of reciprocity
increased 843,000 tons; but from 1850 to 1857 it had increased 1,670,000 tons,
or more than double under Free-trade what it did under Protection. (Cries of
“Bosh!”) It has been proved further, that the entries inwards and clearances
outwards—(confusion, “Hear, hear!” and “No!”) It does not suit, you to hear the
truth—you Protectionist shipowners! (Confusion.) I say it has been proved that the
entries and clearances of British shipping have increased (cries of “Hear!” “No!”
“Turn him out!”) in a ratio equally as great as the tonnage built and registered.
(The hon. gentleman was here met by a storm of indignant and discordant cries,
among which were heard: “Go to Sunderland!” “Rubbish!” “Bosh!” “Sit down!”)
When order was restored the hon. member resumed as follows:—Mr. Bramley-
Moore has referred to what he calls the advantages which Spain and France have
gained by their protective system. (Uproar.) It is quite true that in the five years
between 1853 and 1857 inclusive, no less than 600,000 tons of Spanish shipping
entered and cleared our ports; but, on the other hand, it is equally true that,
during the same period, no less than 1,700,000 tons of British shipping entered
and cleared from Spanish ports. (“Hear, hear!”) What does Spain, therefore, gain
by her system of protection? (Confusion, and a voice, “We can see all that in the
‘Times.’”) It is true that 3,900,000 tons of French shipping cleared for the ports of
England during a similar period; but it is no less true that 10,000,000 tons of
British shipping entered and cleared from the French ports. (“Hear, hear!” and
“Question!”) I could go on with many more facts to prove my case. I can prove to
you by undeniable facts that the British shipping interest, however much it may be
distressed at the present time, has been a gainer by the policy of Free-trade
(shouts of disapprobation), and that it is not for your interest as Shipowners to
reverse that policy. (Uproar.) You, no doubt, wish to confine your trade to your
own possessions (“No, no!”), but what, I ask, would England be if it were not for
the vast magnitude of her trade with foreign countries? (Cries of “Oh, oh!” “Hear,
hear!” and “No, no!”) On referring to the Customs’ entries and clearances, it will be
found that out of the 5,000,000 tons of British shipping annually so entered,
2,000,000 came from our own colonies and dependencies, but that no less than
3,000,000 of British shipping are entered from foreign countries (“Hear, hear!” and
confusion), thus proving that our trade with foreign countries is much more
valuable to us than the trade with our own possessions (cries of “Question!”); and
thus proving, further, that our trade with foreign countries is of greater advantage,
even to the British Shipowner, than our trade with our own colonies and
dependencies. (“Question, question!”) If instead of the resolution proposed you
adopted such a resolution as I have sketched out since I have been in the room it
would have been better for your interest. (Uproar, and cries of “Sit down!”) You
may not think it for your interest, but the day will come when you will find it for
your interest. (Disapprobation.) If instead of looking after the shadow, you would
follow and grasp at the substance it would be better for you. (Uproar.) Have any of
you looked at the existing burdens on British shipping? I have done so; but I will
not occupy the time of the meeting by going into details. (Great cheering.) I must,
however, tell you that these burdens are a serious hindrance to our onward
progress; and I also tell you, and I tell you as a thinking man, that you are vainly
attempting to get what you call reciprocity enforced. I say vainly, because you will
never get it. (“Oh, oh!”) You are losing a chance, a favourable opportunity of
obtaining relief from those burdens which still unjustly oppress the British
shipowners. (A Voice:—“What is the amount?”) I am asked what is the amount?
The amount of these burdens reaches nearly 1,000,000l. sterling. They are 2 per
cent. upon the amount of the capital invested. Tax any interest 2 per cent., and
what is the consequence? You will drive the capital employed in that interest
elsewhere. (“Hear, hear!”) While that real grievance exists, you are following a
shadow (“Oh, oh!”) How futile then are your attempts! (Confusion.) You are
allowing the opportunity to pass of obtaining substantial relief while you are
following this delusion of Protection. (Great uproar.) The policy I have
recommended is the policy which is best for the interests of the British Shipowner,
and it is as a British Shipowner that I advocate it. It is, as the representative of a
large maritime constituency, that I have come forward regardless of your insults to
state my opinions frankly on the subject, and to enter my solemn protest against
the course of policy you vainly attempt to restore. (Great disapprobation.)
Mr. Duncan Dunbar rose to order. He said that they had not met there to discuss
what had brought the shipping interest to its present state; for he thought the fact
would be universally admitted that the Shipowners were on the road to ruin.
(“Hear, hear!”) The object of the meeting, therefore, was not to discuss figures
and tonnage, but simply to agree to a petition to the Houses of Parliament, asking
them to appoint committees to hear the evidence of witnesses on the subject. His
friend Mr. Lindsay,—no, he would not call him his friend (cheers and laughter), but
the gentleman who spoke last went beside the mark in talking about the increase
or decrease of tonnage. All must admit that the Shipowners were on the road to
ruin. (“Hear, hear!”) The very property he had made by his industry and hard
labour was melting away like snow before the sun. (“Hear!”) The man who called
himself a British Shipowner, and moved such an amendment as the present, was
the worst enemy the British Shipowner could have. (Cheers.)
[200] See ‘Hansard,’ vol. clvi. pp. 332 to 347, and p. 347 et seq.
[201] An Act for compensating the families of persons killed by accident 9 & 10
Vict. c. 93; the Merchant Shipping Act 1854; the Merchant Shipping Amendment
Act (1855); the Passenger Act (1855); and the Chinese Passenger Act (1855).
[202] The following were the Members of the Committee:—Mr. Milner Gibson (then
President of the Board of Trade), Lord Lovaine (now the Duke of Northumberland),
Mr. (now Lord) Cardwell, Mr. Thomas Baring, Mr. Crawford, Mr. Francis Baring, Mr.
Somes, Mr. Gore Langton, Mr. George William Bentinck, Mr. Wilcox, Mr. Liddell
(now Lord Eslington), Mr. Francis Russell, Mr. Hugh Taylor, Mr. Alderman Salomons,
and Mr. Lindsay.
[203] Though the Foreign Office is admirably administered, and was brought into
a state of high perfection in all its details by Mr. (now Lord) Hammond, there can
be no doubt that it is very ineffective in its dealings with foreign nations on nearly
all commercial matters. Perhaps, this would be remedied if the Diplomatic and
Consular Service were amalgamated, or even if it was permitted for gentlemen in
the Consular to rise to the Diplomatic Service. I was strongly impressed with this
idea when serving as a member on the Consular Committee of 1856-57; but my
colleagues on that Committee were generally of a different opinion.
Unquestionably our diplomatists are gentlemen in every sense of that word, and,
as a rule, distinguished scholars, but they lack that description of knowledge which
is expected from the representatives of by far the greatest commercial and
maritime nation in the world. The time is fast approaching when this may prove a
serious obstacle to our further progress. As times now go, we are a workshop or
we are nothing. I respect rank and envy learning; but these will not feed the rising
and increasing generations, who are to fill our vacant places.
[204] That Portugal gained nothing by her restrictive policy those of my readers
who care to know may see by referring to a letter which I addressed by request of
its President to the Commercial Association of Lisbon, when there in 1863. See
Appendix No. 6, p. 596.
[205] Since 1860 the law has been altered so far that the responsibility of foreign
ships in our courts is limited on the same conditions, and to the same amount, as
British ships, and these are now limited in the States, as well as in the Federal
Court of the United States.
[206] When I visited the United States after Parliament rose that session (1860),
the question of responsibility was one, to which, with others, I invited the
attention of the Shipowners of that country at various meetings, with their
chambers of Commerce and Boards of Trade, which were frequently held in public.
As the whole of these questions refer directly to merchant shipping and seamen, I
have given in the Appendix of this work, No. 2, p. 567, a copy of a letter I
addressed to Lord Lyons on my arrival in Boston (U.S.), which embraces the whole
of them, as also a subsequent correspondence which I had in 1866 with our
Foreign Office (see Appendix No. 3, p. 571), on the subject of the then
unsatisfactory state of our relations with America, with regard to the responsibility
of British Shipowners when sued in their State Courts. I have the less hesitation in
giving this correspondence as it has not hitherto been published, and as some of
the questions in my letter to Lord Lyons still wait solution.
[207] Since 1860 all passing tolls have been abolished, while most of the local
charges have either been modified or swept away, but not, however, without a
hard struggle, or without the payment of a large grant of public money to
compensate the persons, corporations, or companies who held “vested interests”—
a grant much greater, I think, than they were entitled to receive.
I remember when Mr. Lowe, in his capacity as Vice-President of the Board of Trade
first brought in this measure, in the Session of 1856, he exclaimed, in reply to
demands of an exorbitant character which were made on the ground of certain
clauses in some very ancient deeds, What care I for your musty charters! or words
to that effect. You could almost see the hair raising the hats from the heads of a
number of old members who held all their property under musty charters. But
though Mr. Lowe was not very far wrong so far as regards some of the monstrous
claims made under ancient charters, and would I daresay, if he had had his own
way, not have paid the claimants one-half the amounts they received, the
expression was so appalling as coming from a member of Government, that Lord
Palmerston at once saw that, after what Mr. Lowe had said, it would be impossible
then to pass the Bill, and with his usual tact referred it to a Select Committee, to
which I shall presently refer.
[208] 24 & 25 Vict., cap. 47.
[209] This was one of the most difficult and intricate questions any minister ever
had to deal with. And for that reason these charges, to which I shall again refer,
were not finally dealt with until 1867.
[210] By Parliamentary Papers, 176, 1871, no less than 1,846,400l. had been
advanced up to that date, on loan for the improvement of trade harbours, and
since then, 350,000l., making in all about 2,200,000l.
[211] The aggregate reductions since 1853 are estimated (see Parliamentary
Paper, No. 27, 1875) at more than 750,000l., or at the rate of 237 per cent. on the
present income of about 316,000l. per annum. Nor has economy been consulted
at the cost of efficiency during the last twenty years, due in a great measure to
the exertions of the late Sir Frederick Arrow, Deputy-Chairman of the Trinity
House.
[212] Passages of clippers from China, 1868 to 1872 inclusive, see Appendix No.
8, p. 611.
[213] The log of this ship on her first voyage from London to Melbourne, thence to
Newcastle (N.S.W.), thence to China, and thence home, will be found in the
Appendix, No. 9, p. 613. She is a “composite” vessel, that is, constructed with iron
frames and wood planking; she is 947 tons register, and her dimensions are 210
feet in length; 36 feet width of beam, and 21 feet depth of hold. She was
designed by Mr. B. Waymouth, now Secretary to Lloyd’s Register. She was built in
1868 by Messrs. Walter Hood and Co., of Aberdeen, for her present owners,
Messrs. George Thompson, Jun., and Co.
[214] This passage of the Thermopylæ, was eight days quicker than those of the
Ariel, Taeping, and Serica, in the great race of 1866[215], and six days quicker
than the Ariel and Spindrift in 1868; the nearest competitor was the Titania in
1871. By her log (see Appendix No. 9, pp. 613-17) the Thermopylæ, in one day of
twenty-four hours, made a run of 330 nautical miles (about 380 statute miles), see
log, 3rd January 1870; or at the average rate of close upon 16 statute miles per
hour!!
[215] This race excited extraordinary interest at the time among all persons
interested in maritime affairs, five ships started for it, the Ariel, Taeping, Serica,
Fiery Cross, and Tartsing. The three first left Foo-chow-foo on the same day, but
lost sight of each other for the whole voyage until they reached the English
Channel, where they again met, arriving in the Thames within a few hours of each
other!!
[216] The Sir Lancelot is also a composite vessel. She was built by Mr. Steele, of
Greenock, for her owner, Mr. James MacCunn, of that place, and was commanded
by Captain Richard Robinson, a native of Maryport, who was brought up in the
service of Messrs. Broklebanks, of Liverpool, and who had, previously to being
placed in command of the Sir Lancelot, made very fast passages in the Fiery
Cross. She is 886 tons register; and her dimensions are—length, 197 feet 6
inches; breadth, 33 feet 7 inches, and depth, 21 feet. This celebrated sailing ship,
in her racing days, spread, when under full sail, 45,500 square or superficial feet
of canvas. She was manned by 30 hands all told, and delivered 1430 tons of tea
(of 50 cubic feet to the ton), and her draught of water, when thus laden, was 18
feet 7 inches forward, and 18 feet 9 inches aft. In addition to about 200 tons
shingle ballast, there was 100 tons of iron kentledge (specially cast for the
purpose), stowed in the limbers—that is, between the ceiling and the outer skin.
This was fitted to the vacant spaces and distributed along the keelson, tapering
towards the foremast and mizen-mast. It gave the ship great stability, and
compensated for the immense height of the masts, which, without the kentledge,
would have made the ship too tender. In the opinion of her owner, it contributed
greatly to the ship’s success. I may add that the bottom, which consists of teak,
was carefully planed before the metal was put on, and was quite as smooth as the
bottom of a yacht.
As everything relating to this famous sailing ship must prove interesting and
instructive to my nautical readers, I do not hesitate to furnish the following details
of her performances, courteously supplied to me (4th October, 1875) by Mr.
MacCunn. “The log,” he says, “of the Sir Lancelot, I regret, is not by me, but I
have pleasure in handing you exact leading particulars of the celebrated passage
referred to (extracted by me at the time, with great minuteness, from the log on
board the ship, 14th October 1869).
“The particulars speak for themselves, and there is no parallel on so distant a
voyage in ocean clipper sailing:—

1869.
Up anchor at Foochow, and left the anchorage 7 a.m. 17th July.
White Dogs bore N.N.E. 15 miles 18th ”
Anjer Light bore E.S.E. 10 ” 7th August.
Land about Buffalo River (Cape) 28th ”
Signalled St. Helena 11th September.
Sighted Lizard 10th October.
Passed Deal 13th ”
Berthed in West India Dock 14th ”

ANALYSIS.

White Dogs to Lizard 84 days.


Foochow anchorage to St. Helena 56 ”
Foochow anchorage to Deal 88 ”
Foochow anchorage to West India Dock 89 ”

“The greatest day’s work of the Sir Lancelot was crossing from Anjer to the Cape,
when she made, by observation, 354 miles in 24 hours. For 7 days (consecutive)
she averaged on the same track, with a beam wind, slightly over 300 miles per
day; but I think the most remarkable feature in the sailing of this ship was the
maintenance of a comparative high speed in light winds, and the great power she
had to beat dead to windward against a strong breeze.
“I may mention that after the racing premium was abolished, and with it the sort
of mania for China clipper sailing, I had 8 feet cut off all the lower masts, and
reduced the masts aloft and the yards in proportion.
“Notwithstanding this the Sir Lancelot is now arrived in London after a voyage
from London to Shanghai with general cargo, thence to New York with a tea
cargo, thence to London with a general cargo—all in 9 months and 2 days.
“I am afraid I am troubling you with too many details, but I feel proud that this
celebrated clipper, one of the very few China clippers left, proves herself in the
tenth year of her life as swift as ever.”
Mr. MacCunn may well be proud of his ship, and such pride is one of the chief
causes of our power and greatness as a maritime nation.
[217] Among those who took the lead in the production and improvement of
clipper ships at that time may be mentioned Captain Maxton, of the Titania, who
had formerly commanded the early iron clippers, Lord of the Isles and Falcon, and
who has, with the assistance of Messrs. Robert Steele and Son, brought out in
successive years the Ariel and Titania, vessels of great beauty. Nor must I overlook
Captain Bullock, who navigated the Challenger through the most successful and
exciting part of her career; and Captain Rodger, who commanded the Kate Carnie,
and subsequently owned the Taeping, Ellen Rodger, Min, and other well-known
clippers. Among the builders, the name of the late Mr. William Pile, of Sunderland,
should not be overlooked: he designed, built, and launched many famous clipper
ships, such as the Spray of the Ocean and the Crest of the Wave, two of the
handsomest sailing vessels that ever floated. The latter vessel once left Shanghai
for London with the American clipper ship, Sea Serpent, a well-known China
trader, which was to receive 30s. per ton extra freight on her cargo of young teas
(which obtain the highest price in their relative qualities), if she beat the Crest of
the Wave. Both ships arrived off the Isle of Wight the same day, but the captain of
the American, leaving his vessel in charge of the pilot, started by railway for
London, and reported the Sea Serpent at the Custom House before his own ship
or the Crest of the Wave had passed through the Downs.
[218] See Appendix No. 10, p. 618. See also No. 14, p. 637.
CHAPTER XV.
First Navigation Law in France, a.d. 1560—Law of Louis XIV., 1643,
revised by Colbert, 1661—Its chief conditions—Regulations for the
French Colonial trade—Slightly modified by the Treaties of Utrecht,
1713, and of 1763, in favour of England—Provisions of 1791 and
1793—Amount of charges enforced—French and English Navigation
Laws equally worthless—“Surtaxes de Pavillon” and
“d’Entrepôt”—“Droits de Tonnage”—Special exemption of Marseilles
—French Colonial system preserved under all its Governments, but
greatly to the injury of her people—English Exhibition of 1851—
Messrs. Cobden and Chevalier meet first there, and ultimately, in
1860, carry the Commercial Treaty—The French, heavy losers by
maintaining their Navigation Laws—Decline of French shipping—Mr.
Lindsay visits France, and has various interviews with the Emperor,
Messrs. Rouher and Chevalier on this subject—Commission of Inquiry
appointed, and Law ultimately passed May 1866—Its conditions—
Repeal Act unsatisfactory to the French Shipowners—Another
Commission of Inquiry appointed, 1870—Views of rival parties—M.
de Coninck—M. Bergasse—M. Siegfried—M. Thiers and Protection
carry the day, and reverse, in 1872, much of the law of 1866—Just
views of the Duke Decazes—Abolition for the second time of the
“Surtaxes de Pavillon,” July 1873.

The first appearance of anything in the shape of a


First Navigation Navigation Law which can be traced in the history
Law in France, of the French nation is to be found about a.d.
a.d. 1560.
1560, during the reign of Charles IX., or rather
during that of his mother, Catherine of Medicis, when Regent. It is of
the most absurdly stringent character, forbidding French subjects,
under any circumstances, to freight foreign vessels in the ports of his
realm. Nor would he allow such vessels to carry from his ports any
kind of merchandise: but, like most other laws of a similarly rigorous
character, they were very imperfectly carried out, and so seldom
enforced that, by degrees, they fell into desuetude.
It was not, however, until the reign of Louis XIV.
Law of Louis (a.d. 1643) that anything like a regular system of
XIV., 1643, Navigation Laws was adopted; and this would
revised by
seem to have been copied from the laws of
Colbert, 1661.
England of that period, inasmuch as it had for its
object that which England had proposed with regard to her own
ships—the protection and the development of the French mercantile
marine. But Colbert, the celebrated finance minister, in 1661,
appears to have devoted considerable attention to this question,
and, though he framed a law, at first as protective in its character as
any of the maritime laws promulgated in England, it was, soon
afterwards, moderately relaxed by his wisdom, in favour of the ships
of other nations.
In the reign of Louis XIV., as also in that of Louis
Its chief XV., various ordinances and regulations were
conditions, likewise issued for the purpose of determining the
conditions necessary to entitle a vessel to the
privileges of a French ship. Thus in the regulation bearing date 24th
October, 1681, and, in several letters as well as in various
ordinances, it was provided that no vessel should be allowed the
privilege of hoisting the French flag, unless she were entirely owned
by the subjects of that country, and unless the names of all the
owners were duly registered. For every offence, or any deviation
from this law, a fine of 1000 livres was inflicted; and, in case of any
repetition of the offence, corporal punishments were ordained
against all captains who navigated, under the French flag, any vessel
of alien ownership. There was, however, no prohibition against the
acquisition of vessels of foreign build. French subjects were allowed
to confer on such vessels the French character by certain
declarations, such as dimensions, where and by whom constructed,
and by registering the names of the owners, and the contract of
sale. No alien was, however, permitted to command a French vessel;
nor, by the ordinance of 27th October, 1727, could even a French
subject do so who had married an alien.
Foreigners were also excluded from any functions of authority; and,
as in the case of the English Navigation Laws, it was ordained that
every vessel should be manned by a crew of which two-thirds, at
least, were French subjects. Indeed, in 1710, French subjects were
forbidden, agreeably with their most ancient Navigation Law, to
import goods from England in any but French bottoms—a law, at
that time, levelled exclusively against this country, as it did not
embrace other nations. This law was, however, abolished, three
years afterwards, by the treaty of Utrecht, though again enforced
when war, subsequently, broke out between the two countries.
Besides this, the duty known by the name of “Droit de tonnage”
(tonnage dues), for the protection of the French mercantile marine,
was levied on all foreign vessels; and, though England obtained a
temporary exemption from it also by the treaty of Utrecht, this duty
remained practically in force till replaced by another tonnage duty in
1793. Indeed, for a long time, absolute prohibition had existed
against all foreign vessels engaging in the carrying trade between
the ports of France, except those of Spain, which in 1768 (January
2nd), by a treaty, known by the name of “Pacte de famille,” signed
by the Kings of France, Spain, the Two Sicilies, and the Duke of
Parma, as members of the reigning Bourbon family, made the
Spaniards free of the existing French trade, and placed them in all
respects on a similar footing, so far as that treaty was concerned,
with the subjects of France. This privilege, though suspended by the
Revolution, was restored by the Convention of 20th July, 1814, and
still remains in force, on the part of France.
The most important element, however, of the
Regulations for ancient Navigation Laws of France was the system
the French of regulations for the purpose of increasing the
Colonial trade.
trade with the French colonies. In its main
features, it has been preserved by all the Governments,
Revolutionary and Constitutional, which have, successively, presided
over the destinies of that country, continuing almost unaltered far
into the present century, when it was materially modified, though
not entirely abolished, by the economical reforms of Napoleon III.
That system, known among French economists
Slightly modified and lawyers under the name of the “Pacte
by the Treaties colonial,” from the implied contract supposed to
of Utrecht,
have been entered into between each colony on its
1713, and of
1763, in favour foundation and the mother-country was, so far as
of England. the rights of the latter were concerned,
characterised by three principles, which dictated,
as far as expediency allowed, all the laws and measures of the
various Governments previously to the Second Empire.
These may be briefly stated as follows:—First, no goods, the growth,
produce, or manufacture of the colonies, were to be carried to any
but a French market. Secondly, the colonial market was to be
reserved for the commodities and produce of the mother-country.
Thirdly, the carrying of all goods between the colonies and the
mother-country was to be reserved for the shipping of France.
These rules, which embodied the spirit and policy of France with
regard to her maritime dealings with her colonies, though
undergoing from time to time various modifications necessitated by
circumstances, have, as far as possible, been upheld and enforced,
and in many cases with considerable severity. Thus, while the
exclusion of alien shippers was jealously secured by the most
stringent measures, as, for instance, by the law of 1727, Article 3, in
which it was further ordained that no foreigners should land with
their ships or other vessels in the ports, bays, or harbours, of the
French colonies and islands, nor navigate within one league round
the said colonies and islands, under penalty of confiscation of their
vessels and cargoes, and a fine of 4000 livres, jointly and severally,
upon the master and his crew. These rigorous prohibitions
concerning sailing near the coast were, however, relaxed in favour of
England, after the cession to this country by France in 1763 under
the Treaty of Paris of various islands on the American coast, but with
reference only to such as were in the vicinity of British possessions.
But these stringent laws, ere long proved most disadvantageous to
France herself, and became a very great hardship to some of her
colonies; for, having lost Canada and Louisiana, which carried on a
flourishing trade with the Antilles, the inhabitants of these islands
were deprived of many essential commodities. Some of their ports
were, consequently, opened to foreign shipping for the importation
of certain enumerated articles, and the exportation of such of the
goods produced by them as could not find a sufficient market within
the French dominions.
Such, in a few words, were the ancient Navigation Laws of France;
nor did the Revolution, which cast aside so many of the most
venerated laws and customs of that country, discard the system of
protection which those ancient laws were assumed to afford to their
shipping. This system, on the contrary, seems to have suited the
views of the chiefs of the revolutionary period, and, being, also, in
accordance with the spirit of the stern legislators of that period, was
rendered by them still more stringent by the addition of special
prohibitions, which their predecessors had not considered expedient.
For instance, a decree of the 13th May, 1791, prohibited the
acquisition from that date of all vessels of foreign build; and on the
21st September, 1793, another decree was issued, of a more
comprehensive character.
But it must be remembered that France was then at war with all the
Powers of Europe as well as with her own Rulers (the King having
been beheaded 21st January, 1793), and, consequently, her
commercial and naval laws were in accordance with the spirit of war,
which has been ever opposed to the progress and well-being of the
people. The laws, therefore, relating to trade and navigation, from
1792 to 1814 must not be considered such as the nation would have
approved of if at peace, but rather as warlike measures, presumed
to be necessary for the welfare, and, indeed, for the very existence
of the nation. England being the nearest and most powerful enemy
of France, as well as the financial supporter of all the other nations
then leagued against her, it is not surprising that French statesmen
should have passed such laws as had special reference to the injury
of her maritime commerce and her power at sea; and that those
laws should have been thought to display a spirit of revenge and
hatred, though in reality they were merely counterparts of our own.
Consequently, Article 3 of the law of the 21st September, 1793,
enacted that “No foreign commodities, productions, or merchandise,
shall be imported into France, or into the possessions or colonies of
France, except directly in French vessels, or in vessels belonging to
the inhabitants of the countries in which the articles imported grew,
were produced or manufactured, or from the ordinary ports of sale
or exportation.” All officers and three-fourths of the crew were
required to be natives of the country of which the foreign vessel
bore the flag, under penalty of the confiscation of the ship and
cargo, and a fine of 300 livres, enforceable under pain of
imprisonment, jointly and severally, against owners, consignees, and
agents of the vessel and cargo, as well as against the captain and
mate. Article 4, copied from the most ancient laws of France,
ordained that foreign vessels should not carry from one French port
to another any commodities, productions, or merchandise, of the
growth, production, or manufacture of France, or of its colonies or
possessions, under penalties similar to those provided under Article
3. Another article stipulated that no vessel should be allowed the
privileges of the French flag, unless built in that country, or in the
colonies, or other possessions of France, or condemned as a prize,
or for any infringement of the laws of the State, and, unless all the
officers and three-fourths of the crew were French.
The provisions of this Act were made more
Amount of complete by those of the decree of the 18th of
charges October of the same year (27 Vindémaire, year II.
enforced.
of the Republic), establishing, among others,
various rules concerning the amount of repair to be done to a
foreign vessel, sold after wreck in the waters of France, to entitle her
to carry the French flag; the amount of repair which a French vessel
might undergo in a foreign country without forfeiting its national
character; and the conditions under which a French subject, resident
abroad, might own a French vessel; together with several
enactments for securing the French character of ships, and for the
proper measurement of their tonnage. At the same time, there was
created by the Act a system of taxes, for the purpose partly of
revenue, and partly of protection, intended to supersede the
previous system of marine taxation, abolished expressly by Article
29. Of these new taxes, some applied to the vessel and some to the
cargo; but the most important of them was a duty, assessed
according to tonnage, though in very different proportions, on all
vessels, whether French or foreign, entering French ports; excepting
French fishing vessels, or privateers, and French vessels returning
from foreign countries. It amounted to three sous[219] per ton on
French vessels of above thirty tons engaged in the coasting trade of
the same French sea-board; to four sous per ton, where the trading
was from the French ports of one sea to those of another; and to six
sous, where the navigation was between France and her colonies or
possessions beyond the limits of Europe. On foreign vessels,
whencesoever they came, an uniform duty of fifty sous per ton was
levied when they discharged their cargoes in French ports.
Such were the most important provisions of these
French and two stringent laws; they were, however, only
English similar, in nearly all respects, to those of England,
Navigation Laws
so much so that they have, frequently, been called
equally
worthless. in France Les Actes de Navigation. Indeed, they
were almost as famous, at the time, in that
country as the so-called celebrated Acts of Cromwell were in Great
Britain—notorious, rather than famous, not for any benefits they
conferred on the people of either country, but because the object of
each was to cripple the maritime and naval resources of the rival
power without enhancing its own; for, in those days, the happiness
and prosperity of one nation was supposed to be best promoted by
increasing its power of summarily inflicting punishment for any
wrongs attributed to its neighbour.
But the absolute rule introduced by the law of the 21st of
September, 1793, against the importation into France of foreign
produce by foreign vessels except those of the country from which
the produce originally came, could, in the nature of things, be only
partially enforced. Supremacy cannot be obtained merely by the will
of a legislator, nor can a stroke of the pen conjure navies into
existence.[220]
The mercantile marine of France, which had almost entirely
disappeared during the wars of the Republic and Empire, progressed
so slowly for some time after the Restoration, that the assistance of
foreign vessels became absolutely necessary for the supply of the
French market. Strange, however, to say, for the supposed
encouragement of the national shipping, and, as the next best
protection that could be given to it, the carrying marine of all other
nations was heavily weighted, by means of duties levied on almost
all the commodities imported in foreign bottoms. In the first tariff,
published after the return of the Bourbons, on the 17th of
December, 1814, with the object of providing for pressing
requirements until a more matured system could be established,
differential duties were imposed on certain goods, more or less
heavy, according as they were imported under a foreign or under the
French flag. The system was developed and perfected by the
Finance Law of the 28th of April, 1816, which established a new
order of things, brought about by the heavy expenses of the
centjours, and of the fine imposed on the French nation by the
treaties of November, 1815. Consequently, most of such articles as
were admitted free under the French flag, were charged with duty
under a foreign one. For goods liable to duty, when imported in
French bottoms, the foreign carrying trade was generally mulcted
with an additional charge through the instrumentality of a series of
differential duties called, respectively, surtaxes de pavillon and
surtaxes d’entrepôt.
The surtaxe de pavillon was the additional duty
“Surtaxes de levied on such commodities when arriving under a
Pavillon,” and foreign flag. The surtaxe d’entrepôt was an
“d’Entrepôt.”
increase in the rate of duty on the same
merchandise, though imported under the French flag, coming from
the warehouses of intermediate countries. An example of both these
taxes with reference to coffee may be drawn from the tariff of the
Finance Law, Article 3, of the 28th of April, 1816;[221] and, by a
further decree of the 26th June, 1841, it was laid down, as a general
rule, that all goods under a foreign flag should pay the highest rate
of duties.
But, although this system of differential duties
“Droits de levied on goods conveyed from their place of
Tonnage.” production in foreign vessels, was somewhat
modified by subsequent decrees and treaties of
reciprocity, it remained, practically, in force, or to a considerable
extent, up to a very recent period, while the droits de tonnage levied
on foreign ships alone, were not abolished until 1867: these tonnage
duties were of the most objectionable and purely protective
character, all French vessels being exempted from this charge.
Happily, however, for France, there was one port where they were
not exacted, and hence this has ever been one of her most
flourishing commercial entrepôts.
By a strange anomaly, Marseilles had been, by the
Special law of the 16th December, 1814, as well as by the
exemption of ordinance of the 19th September, 1777, put out of
Marseilles.
the pale of the tonnage duty, and made
substantially a free port. This exception, the revival of a still older
privilege, had been conceded for the purpose of drawing again to
Marseilles, as far as possible, the trade of the Mediterranean, which,
during the long period of warfare through which France had passed,
had been taken possession of by her rivals in that sea, principally, by
the Genoese. The Marseillais considered it as a very great
advantage; and Cette, besides other ports of the Mediterranean,
solicited a like exemption from a duty they justly regarded much
more as an evil than a protection; but in vain, till the time when, as
will be explained hereafter, the whole of France was admitted to the
freedom which had so long been the exclusive privilege of a single
port.
The policy of France with regard to her colonies
French Colonial under the first Republic was continued by
system subsequent Governments, subject, however, to
preserved under
many qualifications and exceptions, by which the
all its
Governments, system lost much of its uniformity and regularity.
But with reference to the treatment of the foreign
mercantile marine, the rule excluding alien vessels from the trade
between France and the generality of her colonies and possessions
was for the most part maintained.
The term Colonie, or Colonie à Culture, is equivalent to the English
word Plantation. Possession or établissement applies to such
settlements as were made more especially for the purpose of
trading, some of the other colonies and settlements being of a mixed
character. In the process of time the name of Colonies, in the
vocabulary of the Fiscal and Navigation Laws, came to be applied in
a stricter sense to the three coffee and sugar islands which had
remained to France, La Guadaloupe, la Martinique, and Bourbon (or
la Réunion as it is now styled). These three colonies had always
been more jealously guarded than the rest from foreign intrusion,
and had remained very much under the same system; a series of
special regulations common to each of them, placing them, as it
were, apart from the rest. The rule as to foreign vessels was still
exclusion, and prohibition against approaching the coast (with an
exception in favour of the English flag by the second Treaty of Paris
in 1763 as already stated) was still, in principle, maintained under
the same penalty of confiscation, a penalty, however, not
unfrequently disregarded.
These restrictive laws, as has been the case with
but greatly to all other countries, while most injurious to the
the injury of her mass of the people of France, are really of no
people.
benefit to the Shipowners of that country, in whose
favour they had been passed and so long adhered to. A few
individuals may now and again have been gainers, to the loss of the
community at large, but a reference to the customs returns of that
country too clearly demonstrates, that its shipping did not keep pace
with the other branches of its commerce, and that, ever since the
time of Charles IX., when the Navigation Laws were first imposed,
France has had to depend, frequently, to its serious loss, on the
ships of foreign nations for supplying its population with, not merely
the luxuries, but the actual necessaries of life: the restrictive system,
therefore, though remaining so long in force and apparent vigour,
has ever exhibited a gradual tendency to decline, and, by slow
degrees, has been worn away by the current of events flowing
towards Free-trade.
It was not, however, until the year 1851 that the
English eyes of the people of France really began to be
Exhibition of opened to the advantages to be derived from a
1851.
policy of commercial freedom. In that year, the
people of Great Britain had reared in one of the beautiful parks, by
which their capital is adorned, an elegant structure. The idea,
originating with the Society of Arts, was readily adopted by the
Prince Consort of our beloved Queen.[222] Perhaps no grander and
nobler idea ever emanated from the mind of man. It had for its
object peace and good will among nations, and no structure,
hitherto erected, ever conveyed a more striking impression of “the
abodes of Peace” than did the Crystal Palace of 1851. To it, all
nations were invited to send specimens of the natural and cultivated
produce of their soil, and the manufactures and arts of their people.
In that marvellous structure, two great and good
Messrs. Cobden men for the first time met—Richard Cobden of
and Chevalier England and Michael Chevalier of France. Men of
meet first there,
such great intelligence could not fail to see how
numerous were the articles exhibited which were
and, ultimately required by the people of both countries where
in 1860, carry they could not be economically produced, but
the Commercial
Treaty.
which were heavily taxed, merely for the special
benefit of the few who produced them, to the
great loss of whole communities; and that, consequently,
productions and manufactures were limited by a system of
protection, alike iniquitous and unnecessary for the purposes of
revenue. They, therefore, resolved to do what they could to modify
the tariffs of both countries, especially France, and thus to secure a
more free interchange of those articles each country produced more
cheaply and more abundantly than the other. The result of their
labours was the Commercial Treaty of 1860.
Although, by the great changes in the English tariff, carried into
effect by Sir Robert Peel (1842-46), the duty on French goods had
been much reduced in England, and on a great number of articles
altogether abolished, France still maintained high duties on most
manufactured articles, and, indeed, prohibited altogether the
importation of various descriptions of cotton and woollen cloths; the
Treaty of 1860 had, therefore, not only the effect of abolishing or
reducing duties still levied on French goods or produce imported into
England, but of abolishing prohibitions and reducing duties on British
goods and manufactures imported into France; and, above all, it
gave an impulse to Free-trade ideas throughout Europe. In fact,
immediately after that Treaty was signed, other treaties were
concluded, on liberal terms, with most of the European States, and
their direct or indirect neighbours. Indeed there was then a general
movement, to a greater or less extent, in favour of increased
freedom of commercial intercourse between all nations.
Had it been possible, it would perhaps have been desirable that a
Treaty of Navigation should have accompanied or been embraced in
the Treaty of Commerce with France, but, as it was considered by
Government advisable to keep the one distinct from the other, a
resolution I submitted for the consideration of the House of
Commons,[223] though unanimously adopted, was held in abeyance
until the Commercial Treaty had been finally adjusted.
The discussion on that motion, however, paved the
The French, way for the changes subsequently made in the
heavy losers by ancient Navigation Laws of France. It was shown,
maintaining
in the most incontrovertible manner, that the
people of that country were serious losers by the
their Navigation maintenance of these laws, and that, by being
Laws. unable to send their produce and manufactures,
on as favourable terms as other nations, to the
markets of the world, they were competing, at a disadvantage to
themselves, while they were likewise sufferers by not being able to
import the raw materials they required from abroad at the lowest
current rates of freight. Practically, thirty-five out of thirty-six millions
of the nation (for I presume that not more than one million of the
inhabitants of France depend for their living, directly or indirectly,
upon its shipping) were paying for the support of the remaining
thirty-sixth million.
Nor does this payment, which their Navigation
Decline of Laws so long enforced, seem to have been of any
French shipping. advantage to the favoured class for whom it was
made. The shipping of France did not increase. On
the contrary, it actually decreased during the whole period when
these laws were enforced with the utmost rigour. While, in the year
1787, France employed 164,000 tons of native shipping in her trade
with foreign countries, she had, forty-three years afterwards, only
156,000 tons. In her colonial trade, which was confined entirely to
her own ships, she employed 114,000 tons of French shipping at the
former period, and only 102,000 tons in the year 1860. But the most
complete answer to those persons who desired still to retain the
Navigation Laws was the remarkable fact that, while the protected
branches of her shipping trade decreased, there was a steady and
not inconsiderable increase in those branches of it, where her ships
had to enter into competition with the vessels of other nations.
Though the motion which the House of Commons
Mr. Lindsay had adopted was in favour of a Treaty, that mode
visits France, of negotiation presented so many objections that,
and has various
nine months after it had been passed, when Lord
interviews with
the Emperor, Russell furnished me with an introduction to Lord
Messrs. Rouher Cowley, it was arranged that we should endeavour
and Chevalier, to induce the French Government to consider this
on this subject. question as one entirely relating to France, and to
urge that she would inquire for herself, and, having done so, to pass
such measures as would be most conducive to the interests of her
own people, irrespectively of other nations.[224] This was the course
subsequently adopted.
There were many enlightened men in that country, as I shall
hereafter show, who entertained opinions favourable to the desired
change, though the prejudice in favour of the ancient laws and
customs had become so strong in the minds of the mass of the
people, that it would have been all but impossible to remove it,
except through the powerful influence of the enlightened monarch
then governing France, who readily saw the advantage the nation
would derive from Free navigation. Consequently, he in due time
appointed a council to inquire into the whole subject.[225]
In the meantime an important step was taken in Colonial Legislation,
which paved the way for more important changes. La Martinique, la
Guadaloupe, and la Réunion (or Bourbon), the only three of her old
sugar plantations which France still possessed, had been long
complaining that the benefits they derived from the Pacte Colonial
had entirely ceased, since the protection which their sugar used to
receive in the French market against foreign sugar, and against that
manufactured in France, had been withdrawn; and that nothing
remained of that system, except the hardships they had to endure
from the exclusion of the foreign trade and flag, and the difficulty
they had in getting rid of their produce, which the French shipping
was not sufficiently numerous to export.
In consequence of these and other[226] representations, a law,
passed on the 3rd July, 1861, enacted (Articles 1 and 2) that all the
foreign commodities allowed to be imported into France were to be
admitted into Guadaloupe, Martinique, and Bourbon, under the same
conditions and duties. Article 3 broke down the barrier which had
hitherto shut out foreign shipping from freedom of access to those
islands. It allowed the importation of foreign goods under every flag,
without distinction, subject, however, to the payment of special
duties, which varied according to the ports from which the goods
were brought, and those to which they were imported. Thus, goods
carried under any foreign flag from Europe or the Mediterranean to
the Antilles, had to pay a duty, per ton, of 20 francs; if to the
Réunion, of 30 francs: and when from the ports of the Atlantic coast
(except the Cape and its territory), to the Antilles, 10 francs; and to
Réunion, 20 francs. The duties, however, imposed by this Article,
were only applicable to such foreign commodities, admissible under
the previous laws, as were not liable to a higher duty. Otherwise,
that duty was to continue in force. Article 6 went further, and
allowed French goods to be carried to the colonies in question, and
their goods to France, in foreign bottoms, subject to a duty of 20
francs per ton of cargo between France and the Antilles, and of 30
francs per ton between France and La Réunion.
The seventh Article granted the like freedom for the exportation of
the goods of the colonies, either to foreign countries or to any other
colony, provided such colony were beyond the limits of the coasting
trade. But the law still excluded the foreign mercantile marine from
entering the Colonial coasting trade, and it was only applicable to
the three colonies mentioned in the Act. Nor were its provisions
applicable to the other French possessions, nor to its coasting trade;
nevertheless, it was an important step towards the freedom of
maritime commerce.
Many difficulties, however, had still to be
Commission of overcome, and though the Conseil, after a most
Inquiry minute inquiry, and the publication of three large
appointed, and
volumes of evidence, reported that great changes
law ultimately
passed May were imperatively required in the laws, their
1866. recommendations did not receive the sanction of
the French legislative chambers until 1866,[227]
and then only after many prolonged discussions.
Among these difficulties may be mentioned the removal of certain
local charges on shipping, which had long been maintained in our
ports, and against the payment of which the French Government
had frequently protested, though neither the vessels of France nor of
other countries were called upon to pay more than those of our own,
except in some special cases, such as the case of ships owned by
freemen, and other locally privileged persons, who were exempt.
These charges differed in every port, and sometimes within the limit
of the same harbour. Some of them were levied by virtue of Acts of
Parliament, but others of a vexatious character, though trifling in
amount, were only claimed by a prescriptive right, through long use.
Those which were levied by prescription were either in the nature of
petty customs, or of duties charged on vessels for anchorage,
keelage, or with respect to ballast or to fees levied on goods in the
nature of cranage, metage, cartage, wharfage; and, in too many
instances, they were extorted for the use of cranes which had no
existence, or of wharves which for ages had tumbled into decay. No
doubt, in ancient times, it was an unquestioned prerogative of the
Crown to create petty customs for local purposes, and, though that
power has long since ceased to exist, when once granted to
corporations or individuals it became assignable, like other property.
It was, therefore, no easy task to abolish them without conceding
the exorbitant demands of their owners, as the Board of Trade found
out when the Vice-President, Mr. Lowe, brought the subject before
Parliament.[228] But France insisted on their abolition, and, since
then, the great bulk of them have been removed, by purchase or
otherwise.
By Article 1 of the law of the 19th May, 1866, all materials raw or
manufactured, including marine engines, intended to form parts of
the construction or equipment of iron or wooden vessels, were
admitted into France duty free. Article 2 abolished the premium
granted by the law of the 6th May, 1841, on all steam-engines
manufactured in France intended for international navigation. Article
3 permitted, after the expiration of six months from the
promulgation of the law, the admission of foreign-built and fully
equipped vessels to registration on payment of two francs per ton
admeasurement; while Article 4 abolished all tonnage duties upon
foreign ships, except such as had been or might be levied for the
improvement of certain commercial harbours.
But other changes were more tardily made: Article
Its conditions. 5 providing that, only after “three years from the
promulgation of the present law, the surtaxes on
the flag (surtaxes de pavillon), at present applicable to productions
imported from the countries where they are produced, otherwise
than under the French flag, shall be abolished;” while Article 6
provided for the ulterior establishment, by imperial decree, of such
compensating duties as might be rendered desirable, in consequence
of any other nation imposing on the French flag higher duties than
were to be levied on its own vessels; thus copying the retaliatory
clause of the English Navigation Repeal Act of 1849. By Clause 7
these various articles were made applicable to the islands of
Martinique, Guadaloupe, and Réunion (or Bourbon); and by Clause
8, the conditions of Articles 1, 3, and 4 were extended to Algeria;
while by Article 9 the trade between France and that colony and its
Coasting trade (cabotage) was permitted to be carried on by foreign
vessels under the authorisation of its governor.
The 10th, or last Article, of the law of 1866, abolished the
differential duties (surtaxes de navigation) which had been imposed
on goods imported under a foreign flag, and the lower rate of duty
on certain commodities, imported from French warehouses, under
the flag of that country.[229]
But the law of the 19th May, 1866, was very far
Repeal Act from giving general satisfaction in France. Many
unsatisfactory to French Shipowners were as loud in their
the French
complaints against it as the most noted
Shipowners.
Protectionist had been in England against the
repeal of her Navigation Laws, and with, perhaps, more valid
reasons. The new law did not give to them that freedom in the
purchase or construction of their ships they had a right to expect.
And though the duty of two francs per ton levied on every ship they
purchased from a foreign country was insignificant, the restrictions,
imposed on all materials necessary for the construction and
equipment of vessels in their own country, were of a harassing and
vexatious character. The measure in itself was good, but various
classes of Protectionists, fearing that numerous articles might be
imported which could be used for other than shipbuilding purposes,
and thus interfere with their own particular branches of trade, had
influence enough with the Legislature to obtain the issue of another
decree[230] on the 8th June following, which nullified in some
important respects the operation of the law of May 1866, and
rendered it less beneficial to the people of France.
Under such vexatious restrictions it was impossible for the
shipbuilder of France to compete successfully with those of other
countries, as they were nearly as prejudicial to his interests as they
would have been by the maintenance of the duties on all the articles
he required. Competition in every branch of commerce throughout
the world is so close, that, wherever the Legislature imposes not
merely taxes but conditions, which, from their nature, must
necessarily interfere with the course of business, and occupy a
considerable portion of the shipbuilder’s time, which is a part of his
capital, he cannot successfully compete with those of other countries
where no such conditions are imposed.
Such restrictions, though in themselves
Another comparatively unimportant, afforded the
Commission of Shipowners of France a lever which they worked
Inquiry
incessantly, hoping with the aid of the other
appointed,
1870. Protectionists, to overthrow in time, the wise and
liberal Act of the 19th May, or at least to abrogate
its leading principles. At last the complaints from the seaports, and
some changes in the administration of affairs, led to the
appointment of a Commission or Parliamentary Committee, with
powers to inquire not merely into the effect of these restrictions, but
into the state generally, of the Commercial Marine of France, and on
the best means of affording it assistance, should any be deemed
necessary or desirable.
Although this Committee, which sat early in the year 1870, never
concluded its labours, its minutes are interesting and instructive,
from the depositions and discussions they embodied, and, more
especially, from the important fact, that not a few even of the
Shipowners themselves, who had previously doubted the policy of
Free-trade as applicable to their own interests, had, within the
previous five years, become converts to the advantages to be
derived from unfettered commerce. But the larger portion of them
were, as, in fact, Shipowners have long been in all countries,
Protectionist. They contended that the French commercial marine
was both absolutely and comparatively in a state of decline, caused,
as they argued, mainly, by the abolition of the protective duties,
which they held were necessary to prevent them from being ruined
by foreign competition. Among the various causes they alleged, as
rendering them unable to compete successfully with the vessels of
other nations, was the want of “bulky freights,” in consequence of
which their ships had frequently to leave France in ballast, or with
incomplete cargoes; and, moreover, that “France, being at the
western border of Europe, English, German, and other northern
vessels, called at her ports, when not fully laden, to complete their
outward cargoes, and compete for French freight with French
shipping.”
On the other hand, the partisans of Free-trade
Views of rival denied that French shipping had declined either
parties. absolutely or in comparison with the commercial
marine of other countries. While conceding the
point that the rates of freight had diminished, they maintained that
such was the case in all other parts of the world; that this, therefore,
was not in any way peculiar to France, such diminution of freight
being, in fact, the natural consequence of a competition which, in
the interests of the community at large, it would be as impossible as
it was undesirable to prevent. Moreover, they showed that, where
their Shipowners had kept pace with the movements of the age, by
substituting iron for wood, and steamers for sailing vessels,
whenever the requirements of the trade necessitated a change, and
in cases, where the masters of these vessels themselves were
enterprising and disposed to seek for freight, wherever it could be
most advantageously procured, they had increased. Thus proving
that the French commercial marine was fully able, if relieved from
needless restrictions, to hold its own against that of any other
nation. What they required was to have the “system of liberty more
completely and logically applied” by the alteration or abolition of
certain oppressive burdens; and by the removal of all troublesome,
onerous, and, frequently, frivolous duties imposed by the French
laws, besides a few other reforms which they specified.
But those Shipowners who favoured the Free-trade movement were,
as has been the case in other countries, assailed as traitors by the
adverse party, who taxed them with having selfish views, at variance
with the true interests of French shipping, owing to their position of
commission agents or shipbrokers, as well as of Shipowners; and, no
doubt, these two interests were conflicting, inasmuch as the profits
on the vessels might be made subservient to other and more
lucrative sources of gain. But this is an old story, which has been
frequently told, and those persons who, in this instance, used it as
an argument, did not perceive that it was double-edged. Nor was it,
indeed, conclusive, as, whatever the motives which prompted the
arguments of the partisans of Free-trade, these arguments were
good and sound in themselves. Besides, there were many
shipowners in France in favour of Free-trade who had no other
interests to serve.
For example, the late M. de Coninck,[231] who was
M. de Coninck. a large shipowner, in his evidence states that he
had given up every other branch of business
except ship-owning—being at the time, as he remarked, “nothing
but a carrier” (charretier). In other respects his evidence was equally
frank and straightforward. The cause, he deliberately told the
Commissioners, the real cause of the complaints of the Protectionist
Shipowners was not loss, properly speaking, but a mere diminution
in their profits;[232] this loss, certainly, had, he as frankly admitted,
been reduced by competition to an average rate, inferior to that of
the palmy days of Protection, during which, he added, the

You might also like