Hejsa.
Jeg har denne kode her.
- <?php
- echo "<p>MySQL Hostname: <input type=\"text\" id=\"mysqlhost\" name=\"mysqlhost\"></p>";
- echo "<p>MySQL Username: <input type=\"text\" id=\"mysqlusername\" name=\"mysqlusername\"></p>";
- echo "<p>MySQL Password: <input type=\"password\" id=\"mysqlpassword\" name=\"mysqlpassword\"></p>";
- echo "<p>MySQL Database: <input type=\"text\" id=\"mysqldatabase\" name=\"mysqldatabase\"></p>";
-
- $_mysqlhost = $_POST['mysqlhost'];
- $_mysqluser = $_POST['mysqlusername'];
- $_mysqlpass = $_POST['mysqlpassword'];
- $_mysqlbase = $_POST['mysqldata'];
- function checkmysql($_mysqlhost, $_mysqluser, $_mysqlpass, $_mysqlbase) {
- echo $_mysqlhost;
- }
-
- echo '<a href="' . checkmysql() . '"><input method="text" type="button" value="Check MySQL" id="checkmysqlbotton"></a>';
- ?>
Som I nok kan se, skal brugeren udfylde nogle felter angående MySQL. Men den giver mig bare fejl, da den siger at den ikke kan finde 'mysqlhost' osv.
Her er mine fejl.
Notice: Undefined index: mysqlhost in C:\wamp\www\test.php on line 7
Notice: Undefined index: mysqlusername in C:\wamp\www\test.php on line 8
Notice: Undefined index: mysqlpassword in C:\wamp\www\test.php on line 9
Notice: Undefined index: mysqldata in C:\wamp\www\test.php on line 10
Warning: Missing argument 1 for checkmysql(), called in C:\wamp\www\test.php on line 15 and defined in C:\wamp\www\test.php on line 11
Warning: Missing argument 2 for checkmysql(), called in C:\wamp\www\test.php on line 15 and defined in C:\wamp\www\test.php on line 11
Warning: Missing argument 3 for checkmysql(), called in C:\wamp\www\test.php on line 15 and defined in C:\wamp\www\test.php on line 11
Warning: Missing argument 4 for checkmysql(), called in C:\wamp\www\test.php on line 15 and defined in C:\wamp\www\test.php on line 11
Notice: Undefined variable: _mysqlhost in C:\wamp\www\test.php on line 12
Felterne og knappen kommer frem.
- Hilsen Magnus.