shayandy Posted November 30, 2008 Share Posted November 30, 2008 I'm quite a beginner with php and have a lot of help with my site but my friends has become unstuck with my current problem. At the top of my page I get this message; Warning: session_start() [function.session-start]: open(/home2/pj41481/tmp/sess_7fde5eaf25b4ac89b9f64a2357cf9757, O_RDWR) failed: No such file or directory (2) in /home/skittle/public_html/include/header.php on line 4 Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/skittle/public_html/include/header.php:4) in /home/skittle/public_html/include/header.php on line 4 Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/skittle/public_html/include/header.php:4) in /home/skittle/public_html/include/header.php on line 4 and at the bottom of my page get this message; Warning: Unknown: open(/home2/pj41481/tmp/sess_7fde5eaf25b4ac89b9f64a2357cf9757, O_RDWR) failed: No such file or directory (2) in Unknown on line 0 Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct () in Unknown on line 0 Any help is greatly appreciated Link to comment https://forums.phpfreaks.com/topic/134916-session-start-problem/ Share on other sites More sharing options...
gevans Posted November 30, 2008 Share Posted November 30, 2008 can u post your code as well? Link to comment https://forums.phpfreaks.com/topic/134916-session-start-problem/#findComment-702607 Share on other sites More sharing options...
revraz Posted November 30, 2008 Share Posted November 30, 2008 Post your header.php code. Check your session save path in your php.ini file. Link to comment https://forums.phpfreaks.com/topic/134916-session-start-problem/#findComment-702608 Share on other sites More sharing options...
shayandy Posted November 30, 2008 Author Share Posted November 30, 2008 This is my header code. Sorry I don't know why the bottom part is ruled out, it isn't usually <?php header("P3P: CP=CAO PSA OUR"); //session information session_start(); $first_name = $_SESSION['first_name']; $surname = $_SESSION['surname']; $logged_in = $_SESSION['logged_in']; $is_admin = $_SESSION['admin']; $player_login_id = $_SESSION['player_id']; //url information $page = $_GET['page']; //admin section information $menu = $_GET['menu']; //general arrays needed for Bowland sports site $team_array[football] = "Football"; $team_array[netball] = "Netball"; $team_array[darts] = "Darts"; $team_array[pool] = "Pool"; $team_array[dominoes] = "Dominoes"; $team_array[cs] = "Carter Shield"; $team_array[gw] = "George Wyatt"; $team_array_sml[football] = "Footy"; $team_array_sml[netball] = "Netball"; $team_array_sml[darts] = "Darts"; $team_array_sml[pool] = "Pool"; $team_array_sml[dominoes] = "Doms"; $team_array_sml[cs] = "Carter S"; $team_array_sml[gw] = "George W"; $squad_array[a] = "A Team"; $squad_array = "B Team"; $squad_array[c] = "C Team"; $squad_array[m] = "Mens"; $squad_array[f] = "Womens"; $squad_array[tow] = "Tug of war"; $squad_array[ab] = "Aeroball"; $squad_array[tt] = "Table Tennis"; $squad_array[db] = "Dodgeball"; $squad_array[kb] = "Korfball"; $squad_array_sml[a] = "A"; $squad_array_sml = "B"; $squad_array_sml[c] = "C"; $squad_array_sml[m] = "M"; $squad_array_sml[f] = "W"; $year_array[1] = "1st Year"; $year_array[2] = "2nd Year"; $year_array[3] = "3rd Year"; $year_array[4] = "4th Year"; $year_array[5] = "5th Year"; $year_array[pg] = "Post Graduate"; $year_array = "Staff"; $title_edit = "Elloughton F.C"; //function to format mysql date function format_date($date_string,$period){ switch($period){ case "day": $form_date[0] = $date_string[8]; $form_date[1] = $date_string[9]; break; case "month": $form_date[0] = $date_string[5]; $form_date[1] = $date_string[6]; break; case "year": $form_date[0] = $date_string[0]; $form_date[1] = $date_string[1]; $form_date[2] = $date_string[2]; $form_date[3] = $date_string[3]; break; case "all": $form_date[0] = $date_string[8]; $form_date[1] = $date_string[9]; $form_date[2] = $date_string[7]; $form_date[3] = $date_string[5]; $form_date[4] = $date_string[6]; $form_date[5] = $date_string[4]; $form_date[6] = $date_string[0]; $form_date[7] = $date_string[1]; $form_date[8] = $date_string[2]; $form_date[9] = $date_string[3]; break; } $final = implode($form_date); return $final; //end of function } function add_paragraphs($document){ $document = str_replace("[p]",'<br/><br/>',$document); $document = str_replace("[P]",'<br/><br/>',$document); $document = str_replace("",'<b>',$document); $document = str_replace("",'</b>',$document); $document = str_replace("[a]",'<a',$document); $document = str_replace("[/a]",'</a>',$document); $document = str_replace("","\"/>",$document); return $document; } function secure_input($input){ $search = array('@<script[^>]*?>.*?</script>@si', // Strip out javascript '@<style[^>]*?>.*?</style>@siU', // Strip style tags properly '@<[\/\!]*?[^<>]*?>@si', // Strip out HTML tags '@<![\s\S]*?--[ \t\n\r]*>@' // Strip multi-line comments including CDATA ); $output = preg_replace($search,'', $input); return $output; } $session_array = session_get_cookie_params(); ?> <!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>Elloughton F.C</title> <link href="../stylesheet.css" rel="stylesheet" type="text/css" /> <!--[if lte IE 6]> <style> #toolbar a {height: 0%;} </style> <![endif]--> </head> <body> <table width="900" border="0" align="center" cellpadding="0" cellspacing="0" id="bs_main"> <tr> <td width="10%" height="80" valign="top" class="bs_banner"> </td> <td height="80" colspan="2" align="right" class="bs_banner_right"><?php if($logged_in != 1){?> <form action="login.php" method="post"> <table border="0" align="right" cellpadding="2" cellspacing="0" class="userform"> <tr> <td align="left" class="userform">E-mail</td> <td align="left" class="userform">Password</td> </tr> <tr> <td><label> <input name="email" type="text" class="formtextinput" size="15"/> </label></td> <td><label> <input name="password" type="password" size="15" /> </label></td> </tr> <tr> <td colspan="2" align="center"><label> <input type="submit" name="submit" value="Login" /> </label></td> </tr> </table> </form> <?php }else{ ?> <!--<a href="index.php?page=account">My Account</a>--> <a href="logout.php">Logout</a> <?php } ?> </td> </tr> <tr> <td width="17%"valign="top" bgcolor="#990000"> <?php //show navigation toolbar include "include/toolbar.php"; //if person is admin or captain show the admin controls if($is_admin == 1){ include "include/admintoolbar.php"; } ?></td> <td width="100%" rowspan="2" valign="top" class="mainTable"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td> </td> </tr> <tr> <td class="mainpane"> <!--Start Footer </td> </tr> </table> </td> <td rowspan="2" valign="top" class="rightTable"><table width="200" height="100%" border="0" class="mainrightpane"> <tr> <td><?php// include("calendar.php");?></td> </tr> </table> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td> </td> </tr> </table></td> </tr> <tr> <td valign="top" height="300" class="left_bar"> </td> </tr> <tr> <td colspan="3" align="center" class="copyright"><p>© Elloughton F.C 2008</p> <script language="JavaScript" type="text/javascript"> if (navigator.appVersion.indexOf("MSIE")!=-1){ document.write("<p><a href=\"http://www.spreadfirefox.com/?q=affiliates&id=0&t=218\"><img border=\"0\" alt=\"Firefox 2\" title=\"Firefox 2\" src=\"http://sfx-images.mozilla.org/affiliates/Buttons/firefox2/ff2o80x15.gif\"/></a></p>");}</script> </td> </tr> </table> </body> </html> --> Link to comment https://forums.phpfreaks.com/topic/134916-session-start-problem/#findComment-702614 Share on other sites More sharing options...
gevans Posted November 30, 2008 Share Posted November 30, 2008 <?php //session information session_start(); header("P3P: CP=CAO PSA OUR"); start the session first Link to comment https://forums.phpfreaks.com/topic/134916-session-start-problem/#findComment-702615 Share on other sites More sharing options...
shayandy Posted November 30, 2008 Author Share Posted November 30, 2008 Thanks, I've done that, but now get these messages; Warning: session_start() [function.session-start]: open(/home2/pj41481/tmp/sess_6fc818f2aa064d48b777ac1b1f1994cd, O_RDWR) failed: No such file or directory (2) in /home/skittle/public_html/include/header.php on line 3 Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/skittle/public_html/include/header.php:3) in /home/skittle/public_html/include/header.php on line 3 Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/skittle/public_html/include/header.php:3) in /home/skittle/public_html/include/header.php on line 3 Warning: Cannot modify header information - headers already sent by (output started at /home/skittle/public_html/include/header.php:3) in /home/skittle/public_html/include/header.php on line 4 Link to comment https://forums.phpfreaks.com/topic/134916-session-start-problem/#findComment-702616 Share on other sites More sharing options...
gevans Posted November 30, 2008 Share Posted November 30, 2008 Post your header.php code. Check your session save path in your php.ini file. in which case as revraz said, check your session save path in your php.ini file Link to comment https://forums.phpfreaks.com/topic/134916-session-start-problem/#findComment-702619 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.