|
99 | 99 | "; |
100 | 100 |
|
101 | 101 | file_put_contents('db.php', $configContent); |
102 | | - |
103 | | - echo "設定が正常に完了しました。<br>"; |
104 | | - echo "Kariの使い方:<br>"; |
105 | | - echo "1. ユーザー名とパスワードを入力してログインします。<br>"; |
106 | | - echo "2. 短縮したいURLを入力します。<br>"; |
107 | | - echo "3. 短縮URLが生成されます。<br>"; |
108 | | - echo "4. 短縮URLをクリックすると、元のURLにリダイレクトされます。<br>"; |
109 | | - echo "<form action=\"setup-kari.php\" method=\"post\">"; |
110 | | - echo "<input type=\"hidden\" name=\"delete\" value=\"true\">"; |
111 | | - echo "<input type=\"submit\" value=\"完了\">"; |
112 | | - echo "</form>"; |
113 | | -} elseif (isset($_POST['delete']) && $_POST['delete'] === 'true') { |
114 | 102 | // 自身のファイルを削除する |
115 | 103 | unlink(__FILE__); |
116 | | - echo "この設定ファイルは削除されました。<br>"; |
| 104 | + $_SESSION['flash_message'] = 'データベースの設定が成功しました。'; |
| 105 | + // 設定が完了したらindex.phpにリダイレクト |
| 106 | + header('Location: index.php'); |
| 107 | + exit; |
| 108 | + |
117 | 109 | } |
118 | 110 | ?> |
119 | 111 |
|
| 112 | + |
120 | 113 | <!DOCTYPE html> |
121 | 114 | <html> |
122 | 115 | <head> |
|
125 | 118 | </head> |
126 | 119 | <body class="bg-gray-100"> |
127 | 120 | <div class="container mx-auto px-4 py-5"> |
128 | | - <h1 class="text-4xl font-bold mb-4">設定 Kari</h1> |
129 | 121 | <form action="setup-kari.php" method="post" class="bg-white shadow-md rounded px-8 pt-6 pb-8 mb-4"> |
130 | 122 | <div class="mb-4"> |
131 | | - <label class="block text-gray-700 text-sm font-bold mb-2" for="servername">サーバー名:</label> |
| 123 | + <label class="block text-gray-700 text-sm font-bold mb-2" for="servername">サーバー名(localhostとかのdbのサーバー名):</label> |
132 | 124 | <input class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" id="servername" name="servername" type="text" required> |
133 | 125 | </div> |
134 | 126 | <div class="mb-4"> |
135 | | - <label class="block text-gray-700 text-sm font-bold mb-2" for="username">ユーザー名:</label> |
| 127 | + <label class="block text-gray-700 text-sm font-bold mb-2" for="username">ユーザー名(dbのユーザー名):</label> |
136 | 128 | <input class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" id="username" name="username" type="text" required> |
137 | 129 | </div> |
138 | 130 | <div class="mb-4"> |
139 | | - <label class="block text-gray-700 text-sm font-bold mb-2" for="password">パスワード:</label> |
| 131 | + <label class="block text-gray-700 text-sm font-bold mb-2" for="password">パスワード(db_userのパスワード):</label> |
140 | 132 | <input class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" id="password" name="password" type="password" required> |
141 | 133 | </div> |
142 | 134 | <div class="mb-4"> |
|
0 commit comments