SitePoint Sponsor |
|
User Tag List
Results 1 to 8 of 8
Thread: allowing header() anywhere???
-
Mar 31, 2003, 21:15 #1
- Join Date
- Jan 2003
- Posts
- 53
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
allowing header() anywhere???
how do you allow using header() anywhere in your program? i made a program for a friend, and he's getting 'headers already sent' warnings.
-
Mar 31, 2003, 21:39 #2
- Join Date
- Apr 2001
- Location
- Canada
- Posts
- 5,458
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
output buffering
Mike
It's not who I am underneath, but what I do that defines me.
-
Mar 31, 2003, 21:44 #3
- Join Date
- Jan 2003
- Location
- Calgary, Canada
- Posts
- 2,063
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Who walks the stairs without a care
It shoots so high in the sky.
Bounce up and down just like a clown.
Everyone knows its Slinky.
-
Mar 31, 2003, 22:21 #4
- Join Date
- Jan 2003
- Posts
- 53
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by cyborg from dh
-
Mar 31, 2003, 22:40 #5
- Join Date
- Jul 2001
- Location
- Missouri
- Posts
- 3,428
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
yes, before any output is sent; or redesign your scripts so that they don't send output before headers.
- Matt** Ignore old signature for now... **
Dr.BB - Highly optimized to be 2-3x faster than the "Big 3."
"Do not enclose numeric values in quotes -- that is very non-standard and will only work on MySQL." - MattR
-
Mar 31, 2003, 23:11 #6
- Join Date
- Jan 2003
- Location
- Calgary, Canada
- Posts
- 2,063
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
yeah either or
(I use ob_start() a lot in my template system though, to capture output for later usage)
Who walks the stairs without a care
It shoots so high in the sky.
Bounce up and down just like a clown.
Everyone knows its Slinky.
-
Apr 1, 2003, 12:49 #7
- Join Date
- Jan 2003
- Posts
- 53
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by cyborg from dh
PHP Code:<html>
<body>
<?php
include("lib/config.php");
include("lib/db_connect.php");
include("lib/chk_ip.php");
if(isset($_POST['do_login'])) {
$username = $_POST['username'];
$password = md5($_POST['password']);
$query = "SELECT * FROM users WHERE username = '$username' AND password = '$password' AND permissions = '1' LIMIT 1";
$result = mysql_query($query);
if(mysql_num_rows($result) != 1) {
header("location:login.php?error=Invalid");
} else {
setcookie("admin",1,time()+(60*30));
setcookie("auth",$username,time()+(60*30));
header("location:admin.php");
}
}
?>
-
Apr 1, 2003, 12:55 #8
- Join Date
- Apr 2001
- Location
- Canada
- Posts
- 5,458
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
Yes, that is why.
Mike
It's not who I am underneath, but what I do that defines me.
Bookmarks