Page 351 - Computer Software Application TP - Volume 1
P. 351
COMPUTER SOFTWARE APPLICATION - CITS
TASK 4: Connect to MySQL database from PHP and update data
i Create an HTML form in the webpage (index.html) to collect the data from the user
1 Open the text editor
2 Write the following codes
<html >
<head> HTML form </title>
</head>
<body>
<h2>Update Data in MySQL Database</h2>
<form method=”post” action=”update.php”>
<label for=”username”>Username of Record to Update:</label><br>
<input type=”text” id=”username” name=”username” required><br><br>
<label for=”email”>New Email:</label><br>
<input type=”email” id=”email” name=”email” required><br><br>
<input type=”submit” value=”Update”>
</form>
</body>
</html>
3 Save the program in C:\Apache24\htdocs in a folder as index.html
336
CITS : IT & ITES - Computer Software Application - Exercise 61