I am trying to get the following statement to work in my form but thought that both should work but I can only get the second one to work
-
if ($update_profile === $first_name) {
echo ‘hello first name’;
header(“Location: update_profile_firstname.php”);
exit(); -
if ($update_profile === ‘first_name’) {
echo ‘hello first name’;
header(“Location: update_profile_firstname.php”);
exit();
This is my form code:
<form class="signup-form" action="update_profile_process.php" method="POST">
<select name="update_profile">
<option value="" selected="selected">Which information would you like to update?</option>
<option value="first_name">First Name</option>
<option value="last_name">Last Name</option>
<option value="username">Username</option>
<option value="email">E-mail</option>
<option value="password">Password</option>
</select>
<input type="hidden" name="csrf" value="<?php echo $csrf; ?>">
<button type="submit" name="submit">Update Student's Information!</button>
I guess is it because I don’t have an option name attribute but just a select name attribute and that is why I can only use method 2?