PHP quickie

SarcasticDwarf

Diamond Member
Jun 8, 2001
9,574
2
76
Here are the first 16 lines of code (meta stuff omitted)

The following works fine:
<html>
<head>
<META name="keywords" content="">
<meta name="">
<meta name="">
<TITLE>Internet Book List :: $pagetitle</TITLE>
</head>
<body>
<link type="text/css" rel="stylesheet" href="site.css" />
<?php
echo "help";
?>
<div id="top"></div>
<div id="content">
<div id="navigation">
<form id="search" method="post" action="#">


This does too
I add this as the first body element:
$link = mysql_connect("localhost", "user", "pass") or die("Error: Could not connect to database.");
mysql_select_db("database") or die("Error: Could not select database.");

This does not

<html>
<head>
<META name="keywords" content="">
<meta name="description" content="">
<meta name="author" content="">
<TITLE>Internet Book List :: $pagetitle</TITLE>
</head>
<body>
<link type="text/css" rel="stylesheet" href="site.css" />

<?php
$userID = $loggedin = $master = $admin = 0;
include 'logdin.php';
?>

<div id="top"></div>
<div id="content">
<div id="navigation">
<form id="search" method="post" action="#">

Lines 21 and 32:
</ul>
<div class="navheader">

Errors - Italicized above
Warning: Cannot modify header information - headers already sent by (output started at /home/user/public_html/development/iblist/dev/index.php:4) in /home/user/public_html/development/iblist/dev/logdin.php on line 8

I get that for lines 8,9,11,12,13,31,32
 

onelin

Senior member
Dec 11, 2001
874
0
0
If you want to set cookies or do header stuff, you must do it before your <head> tag...I can't really see what you're doing if that isn't it w/ this code
 

SarcasticDwarf

Diamond Member
Jun 8, 2001
9,574
2
76
Originally posted by: onelin0
If you want to set cookies or do header stuff, you must do it before your <head> tag...I can't really see what you're doing if that isn't it w/ this code

So it would be
<html>
<?php
whatever
?>
<head>
</head>
<body>
</body>
</html>


I put those lines in that spot and I still get the same.