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> </p>
</div>
<div class="footer">
<center><p>© Copyright 2010</p></center>
</div>
</div>
</body>
</html>














