| |
|
|
| | Пишет что в 143 строке. не как не могу найти.
<?php
include ('func.php');
session_start();
$name = $_POST['name'];
$pass = $_POST['pass'];
if (isset($_POST['action']))
$action = $_POST['action'];
else
$action = $_GET['action'];
if (isset($_POST['account']))
$accaunt = $_POST['account'];
else
$accaunt = $_GET['account'];
$id_msg = $_GET['id_msg'];
$to = $_POST['to'];
$cc = $_POST['cc'];
$subject = $_POST['subject'];
$msg = $_POST['msg'];
{
}
if($action == 'log_out')
{
session_destroy();
unset($action);
unset ($_SESSION['name']);
}
switch($action)
{
case 'del_account':
{
del_account($_SESSION["auth_user"]);
break;
}
case 'save':
{
save_account($_SESSION["auth_user"], $_POST);
break;
}
case 'select_account':
{
$_SESSION["select_account"] = $account;
}
}
$buttons = array();
$buttons[0] = "Посмотреть ящик";
$buttons[1] = "Новое сообщение";
$buttons[2] = "Создать учетную запись";
switch ($action)
{
case 'save':
case 'setup_account':
case 'del_account':
{
show_setup_account($_SESSION['auth_user']);
break;
}
case 'send_msg':
{
if(send_msg($to, $cc, $subject, msg))
echo "Сообщение отправленно";
else
echo "Невозможно отправить сообщение";
break;
}
case 'del_msg':
{
del_msg($_SESSION['auth_user'],
$_SESSION['select_account'], $id_msg);
}
case 'select_account':
case 'view_mailbox':
{
show_list($_SESSION['auth_user'],
$_SESSION['select_account']);
break;
}
case 'show_headers':
case 'hide_headers':
case 'view_msg':
{
$full_headers = ($action=='show-headers');
show_msg($_SESSION['auth_user'],
$_SESSION['select_account'],
$id_msg, $full_headers);
break;
}
case 'reply-all':
{
if(!$imap)
$imap = open_mailbox($_SESSION['auth_user'],
$_SESSION['SELECT_ACCOUNT']);
if($imap)
{
$header = imap_header($imap, $id_msg);
if($header->reply_to_address)
$to = $header->reply_to_address;
else
$to = $header->from_address;
$cc = $header->cc_address;
$subject = 'Re: '.$header->subject;
$body = add_quoting(stripslashes(imap_body($imap, $id_msg)));
imap_close($imap);
show_new_msg_form($_SESSION['auth_user'],
$to, $cc, $subject, $body);
}
break;
}
case 'reply':
{
if(!$imap)
$imap = open_mailbox($_SESSION['auth_user'],
$_SESSION['select_account']);
if($imap)
$header = imap_header($imap, id_msg);
if($header->reply_to_address)
$to = $header->from_to_address;
else
$to = $header->from_address;
$subject = 'Re: '.$header->subject;
$body = add_quoting(stripslashes(imap_body($imap, id_msg)));
imap_close($imap);
show_new_msg_form($_SESSION['auth_user'],
$to, $cc, $subject, $body);
}
break;
}
case 'forward':
{
if(!$imap)
$imap = open_mailbox($_SESSION['auth_user'],
$_SESSION['select_account']);
if($imap)
{
$header = imap_header($imap, $id_msg);
$body = add_quoting(stripslashes(imap_body($imap, $id_msg)));
$subject = 'Fwd: '.$header->subject;
imap_close($imap);
show_new_msg_form($_SESSION['auth_user'],
$to, $cc, $subject, $body);
}
break;
}
case 'new-message':
{
show_new_msg_form($_SESSION['auth_user'],
$to, $cc, $subject, $body);
break;
}
}
?>
|
И во втором файле в 34.
<?php
function show_setup_account($auth_user)
{
show_account_form($auth_user);
$list = get_account_form($auth_user);
$account = sizeof($list);
foreach($list as $key => $account)
{
show_account_form ($auth_user,
$account['id_account'],
$account['server'],
$account['remoteuser'],
$account['remotepass'],
$account['type'],
$account['port']);
}
}
function _get_account($auth_user)
{
$query = "SELECT * FROM account WHERE name = '$auth_user'";
$result = mysql_query($query);
if($result)
{
$var = mysql_fetch_array($result, MYSQL_NUM);
return list($var);
}
else return false;
}
function save_account($auth_user, $var)
{
$query = "INSERT INTO account VALUES ('auth_user',
'$var[server]', $var[port],
'$var[type]', '$var[remoteuser]',
'$var[remotepass]', NULL)";
function del_account($auth_user, $id_account)
{
$query = "DELETE FROM account WHERE id_account='$id_account'
and name = '$auth_user'";
$result = mysql_query($query);
return $result;
}
function show_list($auth_user, $id_account)
{
if(!$id_account)
{
echo "Почтовый ящик не выбран";
}
else
{
$imap = open_mailbox($auth_user, $id_account);
$headers = imap_header($imap);
$msg = sizeof($headers);
for($i = 0; $i<$msg; $i++)
{
}
}
}
function open_mailbox($auth_user, $accountid)
{
if (naamber_of_accounts($auth_user)==1)
{
$account = get_account_name($auth_user);
$_SESSION['select_account'] = $account[0];
$id_account = $accaunt[0];
}
$var = get_account ($auth_user, $accountid);
if(!size($var)) return 0;
$mailbox = '{'.$setting[server];
if($var[type]=='POP3')
$mailbox .='/pop3';
$mailbox .= ':'/$settings[port].'}INBOX';
@ $imap = imap_open($mailbox, $var['remoteuser'],
$var['remotepass'],
return $imap;
}
function namber_of_accounts($auth_user)
{
$query = "SELECT COUNT(*) FROM account WHERE name = '$auth_user'";
$result = mysql_query($query);
if($result)
return mysql_query($result, 0);
}
return 0;
}
function show_msg($auth_user, $id_account, $id_msg, $full_headers)
{
$msg = array();
$imap = open_mailbox($auth_user, $id_account);
$header = imap_header($imap, $id_msg);
$msg['body'] = imap_body($imap, $id_msg);
if(!$msg['body'])
$msg['body'] = "[Отсутствует тело письма]"
$msg['subject'] = $header->subject;
$msg['from_address'] = $header->fromaddress;
$msg['to_address'] = $header->toaddress;
$msg['cc_address'] = $header->ccaddress;
$msg['date'] = $header->date;
imap_close($imap);
return $msg;
}
function del_msg($auth_user, id_account, id_msg)
{
$imap = open_mailbox($auth_user, $id_account);
if($imap)
{
imap_delete($imap, $massege_id);
imap_expunge($imap);
imap_close($imap);
return true;
}
else return false
}
|
| |
| |
|
|
| |
|
|
| |
для: brys
(28.03.2007 в 04:24)
| | | одну ошибку нашел
@$imap = imap_open($mailbox, $var['remoteuser'],
$var['remotepass'],
|
нет скобки закрывающейся | |
| |
|
|
| |
|
|
| |
для: brys
(28.03.2007 в 04:24)
| | | По первому файлу.
в блоке:
case 'reply':
{
if(!$imap)
$imap = open_mailbox($_SESSION['auth_user'],
$_SESSION['select_account']);
if($imap)
$header = imap_header($imap, id_msg);
if($header->reply_to_address)
$to = $header->from_to_address;
else
$to = $header->from_address;
$subject = 'Re: '.$header->subject;
$body = add_quoting(stripslashes(imap_body($imap, id_msg)));
imap_close($imap);
show_new_msg_form($_SESSION['auth_user'],
$to, $cc, $subject, $body);
}
break;
}
|
Уберите } перед break; | |
| |
|
|
| |
|
|
| |
для: zerocool
(28.03.2007 в 09:07)
| | | Во втором файле в строке
$msg['body'] = "[Отсутствует тело письма]"
|
нету точки с запятой в конце | |
| |
|
|
| |
|
|
| |
для: brys
(28.03.2007 в 04:24)
| | | такое ощущение возникает, что у вас напрочь отключены все напоминания об ошибках. =)
Иначе бы их давно бы уже исправили сами | |
| |
|
|
| |
|
|
| |
для: Sl
(28.03.2007 в 09:45)
| | | Убираю эти ошибки появляются еще | |
| |
|
|
| |
|
|
| |
для: brys
(28.03.2007 в 04:24)
| | | Пожалуйста пишите сообщение об ошибке - код с использованием MySQL зачастую нельзя воспроизвести
PS Такие здоровые листинги лучше прикреплять в виде архива, просто большинство не будут открывать здоровую тему больше одного раза. | |
| |
|
|
| |
|
|
| |
для: cheops
(28.03.2007 в 13:13)
| | | в ссылается на второй фаил
Parse error: parse error, unexpected ';', expecting '=' in C:\AppServ\www\pro_mail\func.php on line 34
|
во втором пишет:
Parse error: parse error, unexpected ';', expecting '=' in C:\AppServ\www\pro_mail\func.php on line 34
|
Вот отрезок кода
function get_account($auth_user)
{
$query = "SELECT * FROM account WHERE name = '$auth_user'";
$result = mysql_query($query);
if($result)
{
$var = mysql_fetch_array($result, MYSQL_NUM);
return list($var);
}
else return false;
}
|
| |
| |
|
|
|