Hi.. gud day.. i'm a beginner in php programming, i just started today and i want to ask a question about the use of the "isset()" function. the code in the .php file comes like this:
<?php
if(isset($_POST["RegisterButton"]))
{
mysql_connect("localhost","root","") or die (mysql_error());
echo "Connected to mysql";
mysql_select_db("myDatabase") or die (mysql_error());
echo "Connected to Database";
}
?>
and here is the .html file:
<html>
<head>
<body>
<center><font size = "15">Registration Form</font></center><br>
<font style = "Comic Sans MS">**Fill up the following**</font><br><br>
<form action = "test1.php" method = "post">
<table width = "80%" border = "0">
<tr>
<td width = "8%">First Name:</td><td width = "8%"><input type = "text" name = "fname" /></td>
<td width = "8%">Last Name:</td><td width = "8%"><input type = "text" name = "lname" /></td>
<td width = "8%">Middle Name:</td><td width = "8%"><input type = "text" name = "mname" /></td>
</tr>
<tr>
<td width = "8%">Age:</td><td width = "8%"><input type = "text" name = "age" /> </td>
<td width = "8%">Address:</td><td width = "8%"><input type = "text" name = "address" /></td>
</tr>
<tr>
<td colspan = "2"><input type = "submit" value = "Register" name = "RegisterButton" /></td>
</tr>
</table>
</form>
</body>
</html>
If i click the Register Button in the .html file, the line
-- echo "Connected to mysql" and
-- echo "Connnected to Database" won't be printed.
Thanks in advance for your help.