joebudden Posted January 8, 2007 Share Posted January 8, 2007 Iv written a script that allows users to delete multiple files from a database using check boxes.However, im gettin this error......Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\p3t\public_php\cw\LINUX\multipledelete.php:1) in C:\p3t\public_php\cw\LINUX\multipledelete.php on line 2here is my process page....[code] <?phpsession_start(); require("cw1/connect.php");require("cw1/dbselect.php");if (!isset($_SESSION['sessEmployee'])){ include("index.php"); return; //a return here terminates the execution of this page.}//create vars to store the two fields we will be using$artefactId = "artefactId";$filename = "filename";//query to get list of items in the table$query = "SELECT artefactId, filename FROM artefact WHERE dbEmployeeId='".$_SESSION['sessEmployee']['id']."' ORDER BY artefactId ASC";$result = mysql_query($query);//if the form was submitted, delete the items selected from the databaseif (isset($_POST["deleted_items"])) {$deleted_items = join(', ', $_POST["deleted_items"]);$query = "DELETE FROM artefact WHERE artefactId IN ($deleted_items)";$result = mysql_query($query);echo 'Files Deleted';echo '<p><a href="viewuploads.php"> View Uploads </a></p>';echo '<p><a href="login.php"> Home </a></p>';return;}require("multipledelete.view.php");?>[/code]And here is my view page .... [code]<!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=iso-8859-1" /><title>TECH3001 – Publishing and Production III – Coursework 1 </title></head><body><form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"><table width="50%" border="1" cellpadding="1" cellspacing="0"><tr><td align="center" width="5%"><b>Id</b></td><td width="40%"><b>Filename</b></td><td align="center" width="5%"><b>Delete</b></td></tr><?php//display the form so the user can delete one or more items from the tablewhile ($row = mysql_fetch_assoc($result)) {echo '<td align="center">'.$row[$artefactId].'</td>';echo '<td>'.$row[$filename].'</td>';echo '<td align="center"><input type="checkbox" name="deleted_items[]" ';echo 'value="'.$row[$artefactId].'" /></td>';echo "</tr>";}echo '<p><a href="login.php"> Home </a></p>';?></table><p><input type="submit" value="Delete Selected Items" /></p></form></body></html>[/code]CAN ANYONE HELP ME PLEASE!!!?? lol its driving me mad, I dont get the error if i put the whole thing into 1 php file Quote Link to comment https://forums.phpfreaks.com/topic/33305-solved-problems-with-session-start/ Share on other sites More sharing options...
magic2goodil Posted January 8, 2007 Share Posted January 8, 2007 can we see index.php too Quote Link to comment https://forums.phpfreaks.com/topic/33305-solved-problems-with-session-start/#findComment-155598 Share on other sites More sharing options...
joebudden Posted January 8, 2007 Author Share Posted January 8, 2007 [code]<!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=iso-8859-1" /> <title>TECH3001 – Publishing and Production III – Coursework 1 </title> </head> <body> <p> <?php if (isset($useCaseOutcomeMessage)) { echo( $useCaseOutcomeMessage . "<br /> \n"); } if (isset($_SESSION['sessEmployee'])) { echo("<ul><li><a href='upload.php' >Upload Files</a><br /> \n</li></ul>"); echo("<ul><li><a href='viewuploads.php' >View Uploads</a><br /> \n</li></ul>"); echo("<ul><li><a href='multipledelete.php' >Delete Multiple Files</a><br /> \n</li></ul>"); echo("<ul><li><a href='logout.php' >Logout</a><br /> \n"); echo("<p>" . $_SESSION['sessEmployee']['UserName'] . " is logged in. <br /><br /></p> \n</li></ul>"); } else { echo("<ul><li><a href='login.php' >Login</a><br /> \n</li></ul>"); } ?> </p> </body> </html>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/33305-solved-problems-with-session-start/#findComment-155599 Share on other sites More sharing options...
magic2goodil Posted January 8, 2007 Share Posted January 8, 2007 hmm..what about these 2 files without any passwords showing and suchrequire("cw1/connect.php");require("cw1/dbselect.php"); Quote Link to comment https://forums.phpfreaks.com/topic/33305-solved-problems-with-session-start/#findComment-155602 Share on other sites More sharing options...
joebudden Posted January 8, 2007 Author Share Posted January 8, 2007 nah it works fine for all my other pages and works fine if i put it all in the same file.its really buggin me Quote Link to comment https://forums.phpfreaks.com/topic/33305-solved-problems-with-session-start/#findComment-155603 Share on other sites More sharing options...
Jessica Posted January 8, 2007 Share Posted January 8, 2007 Did you read this thread?http://www.phpfreaks.com/forums/index.php/topic,37442.0.htmlIn the code you pasted, you have a space right here: <?phpsession_start();That space is being sent to the browser, if that is in your code. Quote Link to comment https://forums.phpfreaks.com/topic/33305-solved-problems-with-session-start/#findComment-155604 Share on other sites More sharing options...
magic2goodil Posted January 8, 2007 Share Posted January 8, 2007 well i was curious if there was something causing it in those 2 required pages...perhaps instead of calling session_start(); make a separate page called startSession.php and use require_once('startSession.php');require_once will check and see if that page has already been loaded aka your session is started by something else and then boom it wont load the session again..meh..that's how i do things on my site Quote Link to comment https://forums.phpfreaks.com/topic/33305-solved-problems-with-session-start/#findComment-155606 Share on other sites More sharing options...
PFMaBiSmAd Posted January 8, 2007 Share Posted January 8, 2007 The error message indicates that output was started on line 1 [b]<?php[/b] I am guessing that you are FTP'ing these files to where they are being executed? A number of times, non-displayable language setting characters exist at the beginning of text files.Make sure that you are FTP'ing in ASCII mode and not BINARY mode.Also, make a new empty file using your program editor and copy/past the contents of the problem file into the new file. Quote Link to comment https://forums.phpfreaks.com/topic/33305-solved-problems-with-session-start/#findComment-155609 Share on other sites More sharing options...
joebudden Posted January 8, 2007 Author Share Posted January 8, 2007 OH MY GOD I AM A T*** , lol ;D [SOLVED]cheers jesirose, you may have just prevented a suicide ;) Quote Link to comment https://forums.phpfreaks.com/topic/33305-solved-problems-with-session-start/#findComment-155611 Share on other sites More sharing options...
Jessica Posted January 8, 2007 Share Posted January 8, 2007 ...What four letter word begins a T?Don't tell me.Have a good one. Quote Link to comment https://forums.phpfreaks.com/topic/33305-solved-problems-with-session-start/#findComment-155615 Share on other sites More sharing options...
magic2goodil Posted January 8, 2007 Share Posted January 8, 2007 t.u.r.d?? Quote Link to comment https://forums.phpfreaks.com/topic/33305-solved-problems-with-session-start/#findComment-155626 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.