<?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_message','folder','server','imap_server','fg_color','link_color','alink_color','bg_color_menu','bg_color_frame','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('".$name."','".$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\" MARGINHEIGHT=8 MARGINWIDTH=8 NAME=\"message_text\">";
} else $main_frame = "<FRAME SRC=\"help.php?".SID."\" MARGINHEIGHT=8 MARGINWIDTH=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>