Location: PHPKode > projects > mBlog > includes/tell_process.php
<?php
require './user_init.php';

$bid = post_param ('bid');
$txt['name'] = post_param ('name');
$txt['email'] = post_param ('email');
$txt['friend_name'] = post_param ('friend_name');
$txt['friend_email'] = post_param ('friend_email');
$txt['tell_body'] = post_param ('tell_body');
$contact_us = post_param ('contact_us');

// get product info
$res = sql_query ("SELECT blog_id, blog_title, blog_summary FROM m_blog WHERE blog_id='$bid' LIMIT 1");
$row = sql_fetch_array ($res);
if (empty($row['blog_id'])) msg_die ('no_blog');

//
$txt = array_merge ($txt, $row);
$txt['detail_url'] = $config['site_url'].'/blog.php?bid='.$bid;
$txt['site_name'] = $config['site_name'];

// load tpl
$enable_summary = $config['enable_summary'];
$body = quick_tpl (load_tpl ($config['skin'].'/mail_tell.tpl'), $txt);

//
if (!validate_email_address ($txt['email'])) msg_die ('TELL_ERROR');
if (!validate_email_address ($txt['friend_email'])) msg_die ('TELL_ERROR');
email ($txt['friend_email'], $lang['l_mail_friend_subject'], $body, 1);
msg_die ('TELL_OK', $txt['friend_email'], -2);
?>
Return current item: mBlog