xref: /webtrees/resources/views/setup/step-4-database-mysql.phtml (revision 8fa10296f379d50098f57cb159e098c429813f7f)
1<?php use Fisharebest\Webtrees\I18N; ?>
2
3<form method="post" autocomplete="off">
4    <input name="lang" type="hidden" value="<?= e($lang) ?>">
5    <input name="dbtype" type="hidden" value="<?= e($dbtype) ?>">
6    <input name="wtname" type="hidden" value="<?= e($wtname) ?>">
7    <input name="wtuser" type="hidden" value="<?= e($wtuser) ?>">
8    <input name="wtpass" type="hidden" value="<?= e($wtpass) ?>">
9    <input name="wtemail" type="hidden" value="<?= e($wtemail) ?>">
10
11    <h2>
12        <?= I18N::translate('Database connection') ?> – MySQL
13    </h2>
14
15    <?php foreach ($errors as $error) : ?>
16        <p class="alert alert-danger"><?= $error ?></p>
17    <?php endforeach ?>
18
19    <?php foreach ($warnings as $warning) : ?>
20        <p class="alert alert-warning"><?= $warning ?></p>
21    <?php endforeach ?>
22
23    <div class="row form-group">
24        <label class="col-form-label col-sm-3" for="dbhost">
25            <?= I18N::translate('Server name') ?>
26        </label>
27
28        <div class="col-sm-9">
29            <input class="form-control" id="dbhost" name="dbhost" type="text" value="<?= e($dbhost) ?>" dir="ltr">
30
31            <p class="small text-muted">
32                <?= I18N::translate('Most sites are configured to use localhost. This means that your database runs on the same computer as your web server.') ?>
33            </p>
34
35            <p class="small text-muted">
36                <?= I18N::translate('If you connect to the database using a UNIX socket, enter the path here and leave the port number empty.') ?>
37            </p>
38        </div>
39    </div>
40
41    <div class="row form-group">
42        <label class="col-form-label col-sm-3" for="dbport">
43            <?= I18N::translate('Port number') ?>
44        </label>
45
46        <div class="col-sm-9">
47            <input class="form-control" id="dbport" name="dbport" pattern="\d+" type="text" value="<?= e($dbport) ?>" dir="ltr">
48
49            <p class="small text-muted">
50                <?= I18N::translate('Most sites are configured to use the default value of 3306.') ?>
51            </p>
52        </div>
53    </div>
54
55    <div class="row form-group">
56        <label class="col-form-label col-sm-3" for="dbuser">
57            <?= I18N::translate('Database user account') ?>
58        </label>
59
60        <div class="col-sm-9">
61            <input class="form-control" id="dbuser" name="dbuser" type="text" value="<?= e($dbuser) ?>" dir="ltr">
62
63            <p class="small text-muted">
64                <?= I18N::translate('This is case sensitive.') ?>
65            </p>
66        </div>
67    </div>
68
69    <div class="row form-group">
70        <label class="col-form-label col-sm-3" for="dbpass">
71            <?= I18N::translate('Database password') ?>
72        </label>
73
74        <div class="col-sm-9">
75            <input class="form-control" id="dbpass" name="dbpass" type="password" value="<?= e($dbpass) ?>" dir="ltr" autocomplete="off">
76
77            <p class="small text-muted">
78                <?= I18N::translate('This is case sensitive.') ?>
79            </p>
80        </div>
81    </div>
82
83    <div class="row form-group">
84        <label class="col-form-label col-sm-3" for="dbname">
85            <?= I18N::translate('Database name') ?>
86        </label>
87
88        <div class="col-sm-9">
89            <input class="form-control" dir="ltr" id="dbname" name="dbname" pattern="[^`'&quot;]{1,64}" type="text" value="<?= e($dbname) ?>">
90        </div>
91    </div>
92
93    <div class="row form-group">
94        <label class="col-form-label col-sm-3" for="tblpfx">
95            <?= I18N::translate('Table prefix') ?>
96        </label>
97        <div class="col-sm-9">
98            <input class="form-control" dir="ltr" id="tblpfx" maxlength="15" name="tblpfx" pattern="^[^`]*$" type="text" value="<?= e($tblpfx) ?>">
99            <p class="small text-muted">
100                <?= I18N::translate('The prefix is optional, but recommended. By giving the table names a unique prefix you can let several different applications share the same database.') ?>
101                <?= I18N::translate('Use letters A-Z, a-z, digits 0-9, or underscores') ?>
102            </p>
103        </div>
104    </div>
105
106    <hr>
107
108    <div class="d-flex justify-content-between">
109        <button class="btn btn-primary" name="step" type="submit" value="5">
110            <?= I18N::translate('next') ?>
111        </button>
112
113        <button class="btn btn-secondary" name="step" type="submit" value="3">
114            <?= I18N::translate('previous') ?>
115        </button>
116    </div>
117</form>
118