Hi all,
I am just starting to learn php.
I am doing this simple task. User should enter text. if text is “london” it should redirect to wikipedias page about London. Otherwise it should say “wrong name”. It always gives me “wrong name” :(.
Here are my codes:
HTML
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
<meta charset="utf-8">
<title></title>
</head>
<body>
<form action="action.php" method="post">
<input type="text" name="text">
<input type="submit" name="text">
</form>
</body>
</html>
and PHP
<html>
<head><title>Website</title></head>
<body>
<?php
if ($text == "london") {
header ("Location: https://en.wikipedia.org/wiki/London");
exit;
} else {
echo "wrong name";
}
?>
</body>
</html>
Thank you very much in advance.