Thread: Sessions
View Single Post

  #6 (permalink)  
Old 11-04-2004
kernel2
 
Posts: n/a
Default Re: Sessions - Thanks

I am using php version 5.0, apache 2.0 and suse 9.1. I tried correct the
error message --> Fatal error: Call to undefined function: session_start()
in /mnt/hdb1/home/web/webmail/mailroom.php on line 20--< Using yast to
install the rpm file and I even compiled it using the php source code.
The docs say that by default session is already enabled in php.

The line I am getting the error on is session_start();


I have been working on this for the past 3 days and now I am fustrated
with it. The old php version 2 was much easer because when you installed
it just worked, now version 5 is a lot harder.

Can you please help me?

Thanks
Phil

<?php
/*
PHPwebmail is a webmail client written in php.

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
USA.
*/

session_start();
require("not_registered.php");

session_register('passwd','name','version','send_m essage','folder','server','
imap_server','fg_color','link_color','alink_color' ,'bg_color_menu','bg_color_fra
me','bg_color_main','sql_host','sql_user','sql_pw' );


// setup user prefs account in DB
if ($db_link = mysql_connect($sql_host,$sql_user,$sql_pw)) {
@mysql_select_db("phpwebmail");
$sql_query = "SELECT * FROM prefs WHERE user='$name'";
$result = mysql_query($sql_query);
// catch SQL errors
if (mysql_errno()) echo ("ERROR ".mysql_error());
if (mysql_num_rows($result) == 0) {
$sql_query = "INSERT INTO prefs (user, name, email)
VALUES('".$n
ame."','".$name."','".$name."@".$server."')";
$result = mysql_query($sql_query);
// catch SQL errors
if (mysql_errno()) echo ("ERROR ".mysql_error());
$main_frame = "<FRAME
SRC=\"prefs.php?".SID."&first_time=yes\" M
ARGINHEIGHT=8 MARGINWIDTH=8 NAME=\"message_text\">";
} else $main_frame = "<FRAME SRC=\"help.php?".SID."\"
MARGINHEIGHT=8 MAR
GINWIDTH=8 NAME=\"message_text\">";
} // if db_link ends
?>

<HTML><HEAD><TITLE>PHPwebmail Version <? print($version); ?></TITLE>
</HEAD>
<FRAMESET ROWS="80,100,*" border=1 Frameborder=1>
<FRAME SRC="iconbar.php?<?php echo SID; ?>" NAME="iconbar"
MARGINHEIGHT=8
MARGINWIDTH=8 SCROLLING=no NORESIZE>
<FRAME SRC="mail_index.php?<?php echo SID; ?>" Frameborder=1
MARGINHEIGHT=
8 MARGINWIDTH=8 NAME="message_index">
<?php echo $main_frame; ?>
</FRAMESET>
</HTML>

<noframes>
<BODY>
PHPwebmail requires frames. Netscape and Internet Explorer both support
frames.
<BR><BR>
<A HREF="http://www.microsoft.com">Microsoft Home Page</A><BR>
<A HREF="http://home.netscape.com">Netscape Home Page</A><BR>

</BODY>
</noframes>
linux:/mnt/hdb1/home/web/webmail #


Reply With Quote