Blinger1
14-11-2008, 04:27 AM
G'day y'all.. Why doesn't this code work? Well, it works but I can't have this part..
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Testing</title>
</head>
<body>
<?php session_start(); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Testing</title>
</head>
<body>
<?php
// Includes the mysql connection page
include("includes/connect.php");
// Check if the submit button was pressed
if (isset($_GET['submit'])) {
..
}else{
$_SESSION['user_id'] = $user_id;
// Redirect to userpanel.php
header('location: userpanel.php');
}
}
}else{
...
?><br />
</body>
</html>
Why is it that that doesn't work? (obviously there is more coding than just that. The error I get is:
Warning: Cannot modify header information - headers already sent by (output started at /home/username/public_html/members/login.php:10) in /home/username/public_html/members/login.php on line 37
line 10: <?php
line 37: header('location: userpanel.php');
+rep when i can :)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Testing</title>
</head>
<body>
<?php session_start(); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Testing</title>
</head>
<body>
<?php
// Includes the mysql connection page
include("includes/connect.php");
// Check if the submit button was pressed
if (isset($_GET['submit'])) {
..
}else{
$_SESSION['user_id'] = $user_id;
// Redirect to userpanel.php
header('location: userpanel.php');
}
}
}else{
...
?><br />
</body>
</html>
Why is it that that doesn't work? (obviously there is more coding than just that. The error I get is:
Warning: Cannot modify header information - headers already sent by (output started at /home/username/public_html/members/login.php:10) in /home/username/public_html/members/login.php on line 37
line 10: <?php
line 37: header('location: userpanel.php');
+rep when i can :)