here is the code.
<form action="welcome8.php" method="request">
<div><label for="firstname"><b>First name:</b>
<input type="text" name="firstname" id="firstname"/></label>
</div>
<div><label for="lastname"><b>Last name:</b>
<input type="text" name="lastname" id="lastname"/></label></div>
<div><input type="submit" value="GO"/></div>
</form>
<?php
$firstname=$_REQUEST['firstname'];
$lastname=$_REQUEST['lastname'];
if ($firstname=='kevin' and lastname=='Yank')
{
echo 'welcome, glorious leader!';
}
else
{
echo 'welcome to our website, '.
htmlspecialchars($firstname, ENT_QUOTES, 'UTF-8').''.
htmlspecialchars($lastname, ENT_QUOTES, 'UTF-8').'!';
}
?>
so the code is only executing welcome to our website, but not performing the if else conditions. pls help
i have changed 'and' with '&&' not working yet.
i also had;
<?php
$name = $_REQUEST['name'];
if ($name == 'Kevin')
{
echo 'Welcome, oh glorious leader!';
htmlspecialchars($firstname, ENT_QUOTES, 'UTF-8') . ' ' .
htmlspecialchars($lastname, ENT_QUOTES, 'UTF-8') . '!';
}
?>
which doesn't work as well, what could be the problem.
<form action="welcome8.php" method="request">
<div><label for="firstname"><b>First name:</b>
<input type="text" name="firstname" id="firstname"/></label>
</div>
<div><label for="lastname"><b>Last name:</b>
<input type="text" name="lastname" id="lastname"/></label></div>
<div><input type="submit" value="GO"/></div>
</form>
<?php
$firstname=$_REQUEST['firstname'];
$lastname=$_REQUEST['lastname'];
if ($firstname=='kevin' and lastname=='Yank')
{
echo 'welcome, glorious leader!';
}
else
{
echo 'welcome to our website, '.
htmlspecialchars($firstname, ENT_QUOTES, 'UTF-8').''.
htmlspecialchars($lastname, ENT_QUOTES, 'UTF-8').'!';
}
?>
so the code is only executing welcome to our website, but not performing the if else conditions. pls help
i have changed 'and' with '&&' not working yet.
i also had;
<?php
$name = $_REQUEST['name'];
if ($name == 'Kevin')
{
echo 'Welcome, oh glorious leader!';
htmlspecialchars($firstname, ENT_QUOTES, 'UTF-8') . ' ' .
htmlspecialchars($lastname, ENT_QUOTES, 'UTF-8') . '!';
}
?>
which doesn't work as well, what could be the problem.