Code: Select all
if($_POST['submit'] == TRUE) {
if($_POST['password'] == '123') {
header('Location:http://google.com');
}
else {
echo 'Wrong password!';
}
}Moderator: General Moderators
Code: Select all
if($_POST['submit'] == TRUE) {
if($_POST['password'] == '123') {
header('Location:http://google.com');
}
else {
echo 'Wrong password!';
}
}Code: Select all
<form enctype="multipart/form-data" action="" method="post">
<input type="password" name="password" />
<input type="submit" name="submit" value="GO!" />
</form>Code: Select all
<?php
if($_POST['submit'] == TRUE) {
if($_POST['password'] == '123') {
header('Location:http://google.com');
}
else {
echo 'Wrong password!';
}
}
?>
<form enctype="multipart/form-data" action="" method="post">
<input type="password" name="password" />
<input type="submit" name="submit" value="GO!" />
</form>
it isn't necessary. header()You should be enclosing the parameter value with double quotes and a trailing slash
Code: Select all
<form enctype="multipart/form-data" action="" method="post">
<input type="password" name="password" />
<input type="submit" name="submit" value="GO!" />
</form>
<?
if($_POST['submit'] == TRUE) {
if($_POST['password'] == '123') {
header("Location: http://google.com/");
}
else {
echo 'Wrong password!';
}
}
error_reporting(E_ALL);
?>Code: Select all
<?
error_reporting(E_ALL);
if($_POST['submit'] == TRUE) {
if($_POST['password'] == '123') {
header("Location: http://google.com/");
}
else {
echo 'Wrong password!';
}
}
?>
<form enctype="multipart/form-data" action="" method="post">
<input type="password" name="password" />
<input type="submit" name="submit" value="GO!" />
</form>
Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>LOLL</title>
</head>
<body>
<?
if($_POST['submit'] == TRUE) {
header("Location: http://google.com/");
exit;
}
error_reporting(E_ALL);
?>
<form enctype="multipart/form-data" action="" method="post">
<input type="submit" name="submit" value="GO!" />
</form>
</body>
</html>Code: Select all
<?
if($_POST['submit'] == TRUE) {
header("Location: http://google.com/");
exit;
}
error_reporting(E_ALL);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>LOLL</title>
</head>
<body>
<form enctype="multipart/form-data" action="" method="post">
<input type="submit" name="submit" value="GO!" />
</form>
</body>It isn't my code!JKM wrote:Warning: Cannot modify header information - headers already sent by (output started at /home/xx/index.php:8) in /home/xx/index.php on line 10Doesn't work...Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>LOLL</title> </head> <body> <? if($_POST['submit'] == TRUE) { header("Location: http://google.com/"); exit; } error_reporting(E_ALL); ?> <form enctype="multipart/form-data" action="" method="post"> <input type="submit" name="submit" value="GO!" /> </form> </body> </html>
Code: Select all
<?
if($_POST['submit'] == TRUE)
header("Location: http://google.com/");
else
echo 'not Yet!';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>LOLL</title>
</head>
<body>
<form enctype="multipart/form-data" action="" method="post">
<input type="submit" name="submit" value="GO!" />
</form>
</body>Code: Select all
<?
if($_POST['submit'] == TRUE) {
header("Location: http://google.com/");
exit;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>LOLL</title>
</head>
<body>
<form enctype="multipart/form-data" action="" method="post">
<input type="submit" name="submit" value="GO!" />
</form>
</body>
</html>Code: Select all
<?
header("Location: http://google.com/");
exit;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>LOLL</title>
</head>
<body>
</body>
</html>Code: Select all
<?php
header("location: 1.html");
?>Code: Select all
<?php
header("location: 1.html");
?>
Code: Select all
<?php
error_reporting(E_ALL);
header("Location: 1.html");
?>