Jump to content



Welcome to KnowledgeSutra - Dear Guest , Please Register here to get Your own website. - Ask a Question / Express Opinion / Reply w/o Sign-Up!
- - - - -

Header Error


5 replies to this topic

#1 dsjoes

    Newbie [Level 1]

  • Kontributors
  • Pip
  • 18 posts

Posted 24 January 2011 - 10:13 PM

i get the below message when i try to use the script near the bottom which deletes from an sql database and the linked file but if i put the script on a page on it's own it works without a hitch. so it is something else on his page that is causing the problem i have tried removing everything but the main design but it is then indicating the error is because of the divs i have used and every time i remove the one it wants it changes to another.

Quote

Warning: Cannot modify header information - headers already sent by (output started at /hermes/bosweb/web230/b2302/ipg.myaccount/test_server/admin/index.php:10) in /hermes/bosweb/web230/b2302/ipg.myaccount/test_server/admin/index.php on line 95

line 95 is this bit
header('Location: index.php');
and line ten is the stylesheet for uploadify

<!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>Testimonials</title>
<link href="../style.css" rel="stylesheet" type="text/css" />
<link href="uploadify/uploadify.css" type="text/css" rel="stylesheet" />
      <script type="text/javascript" src="uploadify/jquery-1.4.2.min.js"></script>
      <script type="text/javascript" src="uploadify/swfobject.js"></script>
      <script type="text/javascript" src="uploadify/jquery.uploadify.v2.1.4.min.js"></script>
      <script type="text/javascript">
      $(document).ready(function() {
        $('#file_upload').uploadify({
          'uploader'  : 'uploadify/uploadify.swf',
          'script'    : 'uploadify/uploadify.php',
          'cancelImg' : 'uploadify/cancel.png',
          'folder'    : '../testimonial_files',
          'auto'      : true
        });
      });
      </script>
      </head>
<body>
<div class="container">
  <div class="header"><br /><br /><br />
 </div>
  <div class="sidebar1">
    <ul class="nav"><b>
      <li><a href="../">Home</a></li>
      <li><a href="/admin/">Testimonials upload</a></li>
      <li><a href="audio/">Audio Testimonials upload</a></li>
      <li><a href="dvds/">Dvd's upload</a></li>
      <li><a href="newsletter/">Newsletter upload</a></li>
      <li><a href="news/">News box update</a></li>
     </b></ul></div>
  <div class="content">
  <center><h2>Admin</h2></center>
  <br />
<center><p><input id="file_upload" name="file_upload" type="file" /></p>
<p><table width="200" border="0">
<form action="insert_test.php" method="post">
  <tr>
    <td align="right">Name:</td>
    <td><input type="text" name="Name" /></td>
  </tr>
  <tr>
    <td align="right">Description:</td>
    <td><input type="text" name="Message" /></td>
  </tr>
    <tr>
    <td align="right">Download:</td>
    <td><input name="Download" type="text" /></td>
    </tr>
    <tr>
        <td colspan="2" align="center"><input type="submit" value="Submit" /></td>
  </tr></form>
</table>

</p>
<br /><br />
<p><?php
// Set Global Vars
$HOST = "";
$USERNAME = "";
$PASSWORD = "";
$DATABASE = "";
$TABLE = "";
// Establish a connection
mysql_connect($HOST, $USERNAME, $PASSWORD) or die(mysql_error());
mysql_select_db($DATABASE) or die(mysql_error());
//==================================================================
// Check if anything is posted
//==================================================================
if (isset($_POST['delete'])) {
    $sql = ("delete from $TABLE where ");
    for ($i = 0; $i < count($_POST['checkbox']); $i++) {
        if ($i != 0) {
            $sql.= "OR ";
        }
        $sql .= " id='" . $_POST['checkbox'][$i] . "'";
        //==================================================================
        // Select file to unlink based on id posted
        //==================================================================
        $sql_file_unlink = "select Download from $TABLE where id = {$_POST['checkbox'][$i]}";
        $result_file_unlink =  mysql_query($sql_file_unlink);
        $row_file_link = mysql_fetch_assoc($result_file_unlink);
        if($row_file_link) {
             unlink('../testimonial_files/' . $row_file_link['Download']);
        }
        //==================================================================
    }
    $result = mysql_query($sql);
    header('Location: index.php');
    exit;
} else {
    // select sql here
    $sql = "select * from `$TABLE` order by `id`;";
    $result = mysql_query($sql);
}
?>
<table  align="center" width="400" border="0" cellspacing="1" cellpadding="0">
     <tr>
      <td colspan="6" align="center"><strong>Testimonials</strong> </td>
    </tr>
    <tr>
        <td><form name="delete" method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>">
                <table width="400" border="1" cellpadding="3" cellspacing="1">
                    <tr>
                        <td align="center"><strong>Select</strong></td>
                        <td align="center"><strong>ID</strong></td>
                        <td align="center"><strong>Name</strong></td>
                        <td align="center"><strong>Description</strong></td>
                        <td align="center"><strong>Download</strong></td>
                        <td align="center"><strong>Last Modified</strong></td>
                    </tr><?php $row = mysql_fetch_assoc($result); ?><?php do { ?>
                        <tr>
                            <td align="center">
                                <input name="checkbox[]" type="checkbox" id="checkbox[]" value="<?php echo $row['id']; ?>">
                            </td>
                            <td align="center"><?php echo $row['id']; ?></td>
                            <td align="center"><?php echo $row['Name']; ?></td>
                            <td align="center"><?php echo $row['Message']; ?></td>
                            <td align="center"><a href="../testimonial_files/<?php echo $row['Download']; ?>">Download</a></td>
                            <td align="center"><?php echo date("j/n/y", strtotime($row["Modified"])) ?></td>
                        </tr>
                      <?php
                      } while ($row = mysql_fetch_assoc($result)); ?>
                        <tr>
                            <td colspan="6" align="center"><input name="delete" type="submit" id="delete" value="Delete"></td>
                        </tr>
                    </table>
                </form>
            </td>
        </tr>
    </table>

</p>
</center>


</div>
  <div class="sidebar2">
    <h4>Text here</h4>
    <p>&nbsp;</p>
  </div>
  <div class="footer">
    <center><p>© Copyright 2010</p></center>
    </div>
  </div>
</body>
</html>
 


#2 sonesay

    |||[ n00b King ]|||

  • Kontributors
  • PipPipPipPipPipPipPipPipPip
  • 958 posts
  • Gender:Male
  • Location:Auckland
  • myCENT:68.27

Posted 24 January 2011 - 10:29 PM

View Postdsjoes, on 24 January 2011 - 10:13 PM, said:

i get the below message when i try to use the script near the bottom which deletes from an sql database and the linked file but if i put the script on a page on it's own it works without a hitch. so it is something else on his page that is causing the problem i have tried removing everything but the main design but it is then indicating the error is because of the divs i have used and every time i remove the one it wants it changes to another.



line 95 is this bit
header('Location: index.php');
and line ten is the stylesheet for uploadify

<!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>Testimonials</title>
<link href="../style.css" rel="stylesheet" type="text/css" />
<link href="uploadify/uploadify.css" type="text/css" rel="stylesheet" />
      <script type="text/javascript" src="uploadify/jquery-1.4.2.min.js"></script>
      <script type="text/javascript" src="uploadify/swfobject.js"></script>
      <script type="text/javascript" src="uploadify/jquery.uploadify.v2.1.4.min.js"></script>
      <script type="text/javascript">
      $(document).ready(function() {
        $('#file_upload').uploadify({
          'uploader'  : 'uploadify/uploadify.swf',
          'script'    : 'uploadify/uploadify.php',
          'cancelImg' : 'uploadify/cancel.png',
          'folder'    : '../testimonial_files',
          'auto'      : true
        });
      });
      </script>
      </head>
<body>
<div class="container">
  <div class="header"><br /><br /><br />
 </div>
  <div class="sidebar1">
    <ul class="nav"><b>
      <li><a href="../">Home</a></li>
      <li><a href="/admin/">Testimonials upload</a></li>
      <li><a href="audio/">Audio Testimonials upload</a></li>
      <li><a href="dvds/">Dvd's upload</a></li>
      <li><a href="newsletter/">Newsletter upload</a></li>
      <li><a href="news/">News box update</a></li>
     </b></ul></div>
  <div class="content">
  <center><h2>Admin</h2></center>
  <br />
<center><p><input id="file_upload" name="file_upload" type="file" /></p>
<p><table width="200" border="0">
<form action="insert_test.php" method="post">
  <tr>
    <td align="right">Name:</td>
    <td><input type="text" name="Name" /></td>
  </tr>
  <tr>
    <td align="right">Description:</td>
    <td><input type="text" name="Message" /></td>
  </tr>
    <tr>
    <td align="right">Download:</td>
    <td><input name="Download" type="text" /></td>
    </tr>
    <tr>
        <td colspan="2" align="center"><input type="submit" value="Submit" /></td>
  </tr></form>
</table>

</p>
<br /><br />
<p><?php
// Set Global Vars
$HOST = "";
$USERNAME = "";
$PASSWORD = "";
$DATABASE = "";
$TABLE = "";
// Establish a connection
mysql_connect($HOST, $USERNAME, $PASSWORD) or die(mysql_error());
mysql_select_db($DATABASE) or die(mysql_error());
//==================================================================
// Check if anything is posted
//==================================================================
if (isset($_POST['delete'])) {
    $sql = ("delete from $TABLE where ");
    for ($i = 0; $i < count($_POST['checkbox']); $i++) {
        if ($i != 0) {
            $sql.= "OR ";
        }
        $sql .= " id='" . $_POST['checkbox'][$i] . "'";
        //==================================================================
        // Select file to unlink based on id posted
        //==================================================================
        $sql_file_unlink = "select Download from $TABLE where id = {$_POST['checkbox'][$i]}";
        $result_file_unlink =  mysql_query($sql_file_unlink);
        $row_file_link = mysql_fetch_assoc($result_file_unlink);
        if($row_file_link) {
             unlink('../testimonial_files/' . $row_file_link['Download']);
        }
        //==================================================================
    }
    $result = mysql_query($sql);
    header('Location: index.php');
    exit;
} else {
    // select sql here
    $sql = "select * from `$TABLE` order by `id`;";
    $result = mysql_query($sql);
}
?>
<table  align="center" width="400" border="0" cellspacing="1" cellpadding="0">
     <tr>
      <td colspan="6" align="center"><strong>Testimonials</strong> </td>
    </tr>
    <tr>
        <td><form name="delete" method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>">
                <table width="400" border="1" cellpadding="3" cellspacing="1">
                    <tr>
                        <td align="center"><strong>Select</strong></td>
                        <td align="center"><strong>ID</strong></td>
                        <td align="center"><strong>Name</strong></td>
                        <td align="center"><strong>Description</strong></td>
                        <td align="center"><strong>Download</strong></td>
                        <td align="center"><strong>Last Modified</strong></td>
                    </tr><?php $row = mysql_fetch_assoc($result); ?><?php do { ?>
                        <tr>
                            <td align="center">
                                <input name="checkbox[]" type="checkbox" id="checkbox[]" value="<?php echo $row['id']; ?>">
                            </td>
                            <td align="center"><?php echo $row['id']; ?></td>
                            <td align="center"><?php echo $row['Name']; ?></td>
                            <td align="center"><?php echo $row['Message']; ?></td>
                            <td align="center"><a href="../testimonial_files/<?php echo $row['Download']; ?>">Download</a></td>
                            <td align="center"><?php echo date("j/n/y", strtotime($row["Modified"])) ?></td>
                        </tr>
                      <?php
                      } while ($row = mysql_fetch_assoc($result)); ?>
                        <tr>
                            <td colspan="6" align="center"><input name="delete" type="submit" id="delete" value="Delete"></td>
                        </tr>
                    </table>
                </form>
            </td>
        </tr>
    </table>

</p>
</center>


</div>
  <div class="sidebar2">
    <h4>Text here</h4>
    <p>&nbsp;</p>
  </div>
  <div class="footer">
    <center><p>© Copyright 2010</p></center>
    </div>
  </div>
</body>
</html>
 

The reason for that error is because you have already began outputting HTML code so redirecting after that point is not possible. You can move your whole PHP code block to the top before you begin your HTML output and it should work.

<?php
// Set Global Vars
$HOST = "";
$USERNAME = "";
$PASSWORD = "";
$DATABASE = "";
$TABLE = "";
// Establish a connection
mysql_connect($HOST, $USERNAME, $PASSWORD) or die(mysql_error());
mysql_select_db($DATABASE) or die(mysql_error());
//==================================================================
// Check if anything is posted
//==================================================================
if (isset($_POST['delete'])) {
    $sql = ("delete from $TABLE where ");
    for ($i = 0; $i < count($_POST['checkbox']); $i++) {
        if ($i != 0) {
            $sql.= "OR ";
        }
        $sql .= " id='" . $_POST['checkbox'][$i] . "'";
        //==================================================================
        // Select file to unlink based on id posted
        //==================================================================
        $sql_file_unlink = "select Download from $TABLE where id = {$_POST['checkbox'][$i]}";
        $result_file_unlink =  mysql_query($sql_file_unlink);
        $row_file_link = mysql_fetch_assoc($result_file_unlink);
        if($row_file_link) {
             unlink('../testimonial_files/' . $row_file_link['Download']);
        }
        //==================================================================
    }
    $result = mysql_query($sql);
    header('Location: index.php');
    exit;
} else {
    // select sql here
    $sql = "select * from `$TABLE` order by `id`;";
    $result = mysql_query($sql);
}
?>
<!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>Testimonials</title>
<link href="../style.css" rel="stylesheet" type="text/css" />
<link href="uploadify/uploadify.css" type="text/css" rel="stylesheet" />
      <script type="text/javascript" src="uploadify/jquery-1.4.2.min.js"></script>
      <script type="text/javascript" src="uploadify/swfobject.js"></script>
      <script type="text/javascript" src="uploadify/jquery.uploadify.v2.1.4.min.js"></script>
      <script type="text/javascript">
      $(document).ready(function() {
        $('#file_upload').uploadify({
          'uploader'  : 'uploadify/uploadify.swf',
          'script'    : 'uploadify/uploadify.php',
          'cancelImg' : 'uploadify/cancel.png',
          'folder'    : '../testimonial_files',
          'auto'      : true
        });
      });
      </script>
      </head>
<body>
<div class="container">
  <div class="header"><br /><br /><br />
 </div>
  <div class="sidebar1">
    <ul class="nav"><b>
      <li><a href="../">Home</a></li>
      <li><a href="/admin/">Testimonials upload</a></li>
      <li><a href="audio/">Audio Testimonials upload</a></li>
      <li><a href="dvds/">Dvd's upload</a></li>
      <li><a href="newsletter/">Newsletter upload</a></li>
      <li><a href="news/">News box update</a></li>
     </b></ul></div>
  <div class="content">
  <center><h2>Admin</h2></center>
  <br />
<center><p><input id="file_upload" name="file_upload" type="file" /></p>
<p><table width="200" border="0">
<form action="insert_test.php" method="post">
  <tr>
    <td align="right">Name:</td>
    <td><input type="text" name="Name" /></td>
  </tr>
  <tr>
    <td align="right">Description:</td>
    <td><input type="text" name="Message" /></td>
  </tr>
    <tr>
    <td align="right">Download:</td>
    <td><input name="Download" type="text" /></td>
    </tr>
    <tr>
        <td colspan="2" align="center"><input type="submit" value="Submit" /></td>
  </tr></form>
</table>

</p>
<br /><br />
<p>
<table  align="center" width="400" border="0" cellspacing="1" cellpadding="0">
     <tr>
      <td colspan="6" align="center"><strong>Testimonials</strong> </td>
    </tr>
    <tr>
        <td><form name="delete" method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>">
                <table width="400" border="1" cellpadding="3" cellspacing="1">
                    <tr>
                        <td align="center"><strong>Select</strong></td>
                        <td align="center"><strong>ID</strong></td>
                        <td align="center"><strong>Name</strong></td>
                        <td align="center"><strong>Description</strong></td>
                        <td align="center"><strong>Download</strong></td>
                        <td align="center"><strong>Last Modified</strong></td>
                    </tr><?php $row = mysql_fetch_assoc($result); ?><?php do { ?>
                        <tr>
                            <td align="center">
                                <input name="checkbox[]" type="checkbox" id="checkbox[]" value="<?php echo $row['id']; ?>">
                            </td>
                            <td align="center"><?php echo $row['id']; ?></td>
                            <td align="center"><?php echo $row['Name']; ?></td>
                            <td align="center"><?php echo $row['Message']; ?></td>
                            <td align="center"><a href="../testimonial_files/<?php echo $row['Download']; ?>">Download</a></td>
                            <td align="center"><?php echo date("j/n/y", strtotime($row["Modified"])) ?></td>
                        </tr>
                      <?php
                      } while ($row = mysql_fetch_assoc($result)); ?>
                        <tr>
                            <td colspan="6" align="center"><input name="delete" type="submit" id="delete" value="Delete"></td>
                        </tr>
                    </table>
                </form>
            </td>
        </tr>
    </table>

</p>
</center>


</div>
  <div class="sidebar2">
    <h4>Text here</h4>
    <p>&nbsp;</p>
  </div>
  <div class="footer">
    <center><p>© Copyright 2010</p></center>
    </div>
  </div>
</body>
</html>
 


#3 k_nitin_r

    Grand Imperial Poobah

  • Kontributors
  • PipPipPipPipPipPipPipPipPipPipPip
  • 1,114 posts
  • Gender:Male
  • Location:Dubai
  • myCENT:50.55

Posted 25 January 2011 - 01:47 PM

Hi!

What you need to do is create an intermediary script that either outputs the header to redirect to index.php or include another file that contains the markup with the stylesheet or anything else that you choose to include. This approach will not only fix the problem that you are experiencing but will also make your code better organized (and I'm sure folks would want to debate on that bit... what constitutes a good design is something fairly subjective).

If you do need more help with the problem, feel free to reply or send me a private message/email/instant message and I'll try to get back to you as soon as I can.

#4 dsjoes

    Newbie [Level 1]

  • Kontributors
  • Pip
  • 18 posts

Posted 25 January 2011 - 05:27 PM

View Postsonesay, on 24 January 2011 - 10:29 PM, said:

The reason for that error is because you have already began outputting HTML code so redirecting after that point is not possible. You can move your whole PHP code block to the top before you begin your HTML output and it should work.

<?php
// Set Global Vars
$HOST = "";
$USERNAME = "";
$PASSWORD = "";
$DATABASE = "";
$TABLE = "";
// Establish a connection
mysql_connect($HOST, $USERNAME, $PASSWORD) or die(mysql_error());
mysql_select_db($DATABASE) or die(mysql_error());
//==================================================================
// Check if anything is posted
//==================================================================
if (isset($_POST['delete'])) {
    $sql = ("delete from $TABLE where ");
    for ($i = 0; $i < count($_POST['checkbox']); $i++) {
        if ($i != 0) {
            $sql.= "OR ";
        }
        $sql .= " id='" . $_POST['checkbox'][$i] . "'";
        //==================================================================
        // Select file to unlink based on id posted
        //==================================================================
        $sql_file_unlink = "select Download from $TABLE where id = {$_POST['checkbox'][$i]}";
        $result_file_unlink =  mysql_query($sql_file_unlink);
        $row_file_link = mysql_fetch_assoc($result_file_unlink);
        if($row_file_link) {
             unlink('../testimonial_files/' . $row_file_link['Download']);
        }
        //==================================================================
    }
    $result = mysql_query($sql);
    header('Location: index.php');
    exit;
} else {
    // select sql here
    $sql = "select * from `$TABLE` order by `id`;";
    $result = mysql_query($sql);
}
?>
<!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>Testimonials</title>
<link href="../style.css" rel="stylesheet" type="text/css" />
<link href="uploadify/uploadify.css" type="text/css" rel="stylesheet" />
      <script type="text/javascript" src="uploadify/jquery-1.4.2.min.js"></script>
      <script type="text/javascript" src="uploadify/swfobject.js"></script>
      <script type="text/javascript" src="uploadify/jquery.uploadify.v2.1.4.min.js"></script>
      <script type="text/javascript">
      $(document).ready(function() {
        $('#file_upload').uploadify({
          'uploader'  : 'uploadify/uploadify.swf',
          'script'    : 'uploadify/uploadify.php',
          'cancelImg' : 'uploadify/cancel.png',
          'folder'    : '../testimonial_files',
          'auto'      : true
        });
      });
      </script>
      </head>
<body>
<div class="container">
  <div class="header"><br /><br /><br />
 </div>
  <div class="sidebar1">
    <ul class="nav"><b>
      <li><a href="../">Home</a></li>
      <li><a href="/admin/">Testimonials upload</a></li>
      <li><a href="audio/">Audio Testimonials upload</a></li>
      <li><a href="dvds/">Dvd's upload</a></li>
      <li><a href="newsletter/">Newsletter upload</a></li>
      <li><a href="news/">News box update</a></li>
     </b></ul></div>
  <div class="content">
  <center><h2>Admin</h2></center>
  <br />
<center><p><input id="file_upload" name="file_upload" type="file" /></p>
<p><table width="200" border="0">
<form action="insert_test.php" method="post">
  <tr>
    <td align="right">Name:</td>
    <td><input type="text" name="Name" /></td>
  </tr>
  <tr>
    <td align="right">Description:</td>
    <td><input type="text" name="Message" /></td>
  </tr>
    <tr>
    <td align="right">Download:</td>
    <td><input name="Download" type="text" /></td>
    </tr>
    <tr>
        <td colspan="2" align="center"><input type="submit" value="Submit" /></td>
  </tr></form>
</table>

</p>
<br /><br />
<p>
<table  align="center" width="400" border="0" cellspacing="1" cellpadding="0">
     <tr>
      <td colspan="6" align="center"><strong>Testimonials</strong> </td>
    </tr>
    <tr>
        <td><form name="delete" method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>">
                <table width="400" border="1" cellpadding="3" cellspacing="1">
                    <tr>
                        <td align="center"><strong>Select</strong></td>
                        <td align="center"><strong>ID</strong></td>
                        <td align="center"><strong>Name</strong></td>
                        <td align="center"><strong>Description</strong></td>
                        <td align="center"><strong>Download</strong></td>
                        <td align="center"><strong>Last Modified</strong></td>
                    </tr><?php $row = mysql_fetch_assoc($result); ?><?php do { ?>
                        <tr>
                            <td align="center">
                                <input name="checkbox[]" type="checkbox" id="checkbox[]" value="<?php echo $row['id']; ?>">
                            </td>
                            <td align="center"><?php echo $row['id']; ?></td>
                            <td align="center"><?php echo $row['Name']; ?></td>
                            <td align="center"><?php echo $row['Message']; ?></td>
                            <td align="center"><a href="../testimonial_files/<?php echo $row['Download']; ?>">Download</a></td>
                            <td align="center"><?php echo date("j/n/y", strtotime($row["Modified"])) ?></td>
                        </tr>
                      <?php
                      } while ($row = mysql_fetch_assoc($result)); ?>
                        <tr>
                            <td colspan="6" align="center"><input name="delete" type="submit" id="delete" value="Delete"></td>
                        </tr>
                    </table>
                </form>
            </td>
        </tr>
    </table>

</p>
</center>


</div>
  <div class="sidebar2">
    <h4>Text here</h4>
    <p>&nbsp;</p>
  </div>
  <div class="footer">
    <center><p>© Copyright 2010</p></center>
    </div>
  </div>
</body>
</html>
 
thanks that worked

#5 Quatrux

    Privileged Member

  • Kontributors
  • PipPipPipPipPipPipPipPipPip
  • 605 posts
  • Gender:Male
  • Location:Lithuania, Vilnius
  • Interests:Programming
  • myCENT:49.19

Posted 07 February 2011 - 12:44 PM

Another solution is to start using output buffering, which will send the produced output only the php script stops executing or when you tell it to do it.

All you need is to use ob_start() function: http://php.net/ob_start

With the combination of ob_* functions, you can make a lot of things quite easily, it lets you control your content and you can start using GZip as a handler for output buffering, but to use it right, I would suggest to read a little bit on this subject - PHP output buffering.

#6 dhi

    Newbie

  • Kontributors
  • Pip
  • 6 posts

Posted 19 December 2011 - 05:54 AM

you cant set header - location inside the body part. you will find this script running perfectly if you set the php code before the body begin.




Reply to this topic


This post will need approval from a moderator before this post is shown.

  


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users