I want to create an update form, but I get this error, when I'm checking if the user has actually inputted anything into the form:
Parse error: syntax error, unexpected T_ISSET in C:\XAMPP\htdocs\update.php on line 30
<?php
session_start();
if (isset($_SESSION['access']))
{
if ($_SESSION['access'] == 1)
{
if(!mysql_connect('******', '*******' , '*****'))
{
echo 'Connection failed. Please try again.';
exit;
}
else
{
$db_link = mysql_connect('*****', '******', '******');
if (!mysql_select_db('******', $db_link))
{
echo 'Error selecting database.';
exit;
}
}
if (!$_POST['UWO_NUM'])
{
echo 'You have not chosen a tutor, please try again.';
exit;
}
$uwonum= $_POST['UWO_NUM'];
if (isset($_POST['Last_Name']) && isset($_POST['First_Name'])
&& isset($_POST['Phone_Num']) && isset($_POST['Extension']) isset($_POST['Email_Address'])
&& isset($_POST['Faculty']) && isset ($_POST['Program_Name']) isset ($_POST['Years_Study'])
isset ($_POST['Years_Study']))
{
$lastname = $_POST['Last_Name'];
$firstname = $_POST['First_Name'];
$phone = $_POST['Phone_Num'];
$extension = $_POST['Extension'];
$email = $_POST['Email_Address'];
$faculty = $_POST['Faculty'];
$program = $_POST['Program_name'];
$studied = $_POST['Years_Study'];
$bios = $_POST['Bios'];
}
$sql = "UPDATE `Tutor_Info` SET `Last_Name` = '$lastname', `First_Name` = '$firstname',
`Phone_Num` = '$phone',
`Extension` = '$extension', `Hide_Num` = '1',
`Email_Address` = '$email', `Faculty` = '$faculty',
`Program_Name` = '$program',
`Years_Study` = '$studied', `Bios` = '$Bios' WHERE `UWO_NUM` = '$uwonum'";
mysql_query($sql,$db_link);
}
$sql = "SELECT * FROM `Tutor_Info` WHERE `UWO_NUM` = '$uwonum' ";
$result = mysql_query($sql,$db_link);
}
else
{
echo 'You are not logged in.';
exit;
}
while ($row = mysql_fetch_assoc($result))
{
?>
<html>
<form method="post" action="<?php echo $PHP_SELF;?>">
<table border="0" cellspacing="5" cellpadding="0">
<tr>
<td>UWO Number:</td>
<td><input type="text" disabled size="12" maxlength="20" name="UWO_NUM" value = "<?php echo $row['UWO_NUM'];?>" ></td>
</tr>
<tr>
<td>Last Name:</td>
<td><input type="text" size="12" name="Last_Name" value = "<?php echo $row['Last_Name'];?>"></td>
</tr>
<tr>
<td>First Name:</td>
<td><input type="text" size="12" name="First_Name" value = "<?php echo $row['First_Name'];?>"> </td>
</tr>
<tr>
<td>Phone Number:</td>
<td><input type="text" size="12" maxlength="10" name="Phone_Num" value = "<?php echo $row['Phone_Num'];?>"></td>
</tr>
<tr>
<td>Extension:</td>
<td><input type="text" size="12" maxlength="10" name="Extension" value = "<?php echo $row['Extension'];?>"></td>
</tr>
<?php
if ($row['Hide_Num'])
{
$row = array("Hide_Num" => "checked");
}
?>
<tr>
<td>Hide Number?<input type="checkbox" name="" value="1" <?php echo $row['Hide_Num']?> /></td>
</tr>
<?php
}
mysql_data_seek($result, 0);
while ($row = mysql_fetch_assoc($result))
{
?>
<tr>
<td>Email Address:</td>
<td><input type="text" size="12" name="Email_Address" value = "<?php echo $row['Email_Address'];?>"></td>
</tr>
<tr>
<td>Faculty:</td>
<td><input type="text" size="12" name="Faculty" value = "<?php echo $row['Faculty'];?>"></td>
</tr>
<tr>
<td>Program Name:</td>
<td><input type="text" size="12" name="Program_Name" value = "<?php echo $row['Program_Name'];?>"></td>
</tr>
<tr>
<td>Years Studied:</td>
<td><input type="text" size="12" name="Years_Study" value = "<?php echo $row['Years_Study'];?>"></td>
</tr>
<tr>
<td>Bio:</td>
<td><textarea rows="5" cols="20" name="Bios" wrap="physical"><?php echo $row['Bios'];?></textarea></td>
</tr>
<tr>
<td></td>
<td><input type="submit" value="Submit" name="submit"></td>
</table>
</form>
</html>
<?php
}
}
?>
Also, is it normal that going to this page takes long to load (like 5 seconds)?