header( 'Location: http://www.ultimatetraderchallenge.com/guest/subscribe' ) ;
//error_reporting(E_ERROR | E_WARNING | E_PARSE);
$message = array();
$email = "";
$name = "";
$stock = "";
if( isset( $_REQUEST['mailsent'] ) )
{
mail_sent() ; return;
}
if( isset( $_REQUEST['received'] ) )
{
mail_already_sent() ;
//echo "bye" ;
return;//asm$
}
if( isset( $_REQUEST['notfound'] ) )
{
stk_not_found() ;
//echo "bye" ;
return;
}
if (isset( $_POST['submitter'] ) )
{
include_once("../Connections/ConnectToSTD.php") ;
//print_r($result) ;
if ( validation() )
{
// $sql = "select count(id) as num from std_month_stock_pdf_email where email = '".$_POST['email']."' and date BETWEEN CURDATE() and DATE_SUB(CURDATE(), INTERVAL 32 DAY) ";
$sql = "select count(id) as num from std_month_stock_pdf_email where email = '".$_POST['email']."' " ;
$result = mysql_query($sql) ;
$res = mysql_fetch_object( $result );
//echo "worker" ;
if( $res->num > 0 ) //asm$
//if( false)
{
$sql = "select count(id) as num from std_month_stock_pdf_email where email = '".$_POST['email']."' and date <= CURDATE() and date >= DATE_SUB(CURDATE(), INTERVAL 32 DAY) ";
//echo $sql;
$result = mysql_query($sql) ;
$res = mysql_fetch_object( $result ) ;
if( $res->num > 0 )
{
// echo "===";
// ob_start();
@header("Location: http://www.stocktradersdaily.com".$_SERVER['SCRIPT_NAME']."?received=1");
// ob_end_flush(); echo "=!=";
exit();
}
else
{
$sql = "select * from std_month_stock_pdf_email where email='".$_POST['email']."'";
$result = mysql_query($sql) ;
$row = mysql_fetch_array($result);
$sql = "update std_month_stock_pdf_email set stock='".strtoupper($_POST['stock'])."', date='".date("Y-m-d")."', request='".$_POST['monthly']."', download='".($row['download']+1)."' WHERE email='".$_POST['email']."'";
$result = mysql_query($sql) ;
$sql = "update std_month_stock_pdf_email_track set last_track_email_date='".date("Y-m-d")."' where std_month_stock_pdf_email_id='".$row["id"]."'";
$result = mysql_query($sql) ;
sent_email($_POST['stock']) ;
}
}
else
{
$date = date("Y-m-d");
// $script = $_SERVER['SCRIPT_NAME'] ;
// $script = str_replace(".php", "", $script );
//$script = explode("/", $script );
// $num = count($script) ;
// $script_name = $script[ $num - 1 ] ;
$sql = "insert into std_month_stock_pdf_email ( name , email , stock , date ,request, phone ) value ('".$_POST['name']."','".$_POST['email']."','".strtoupper($_POST['stock'])."','".$date."' , '".$_POST['monthly']."', '".$_POST['phone']."') ";
$result = mysql_query($sql) ;
$std_month_stock_pdf_email_id = mysql_insert_id();
$sql = "insert into std_month_stock_pdf_email_track (std_month_stock_pdf_email_id, last_track_email_date) value ('".$std_month_stock_pdf_email_id."', '".date("Y-m-d")."')";
$result = mysql_query($sql) ;
sent_email($_POST['stock']) ;
}
}
else
{ form();}
}
else
{ form();}
?>
/* ***********************************************************
page to show the messsage for the already sent mail
################################################################# */
function mail_already_sent()
{
echo "We're Sorry, you have already received 1 Free Report this month. We only allow 1 Free Report per month. However, for our Report Subscribers, we offer a 1-time opportunity to receive unlimted reports, and access to all of our services for for just $75. We normally charge $299. If you want this discount, take advantage of it now. Click here:
Special Discount for Report Subscribers";
}
?>
/* ***********************************************************
page to show the messsage for the mail sent
################################################################# */
function mail_sent()
{
echo "Congratulations your request has been processed. An e-mail has been sent to ".$_REQUEST['email']." , which contains an updated ".$_REQUEST['stock']." Report as a PDF attachment. If you have any additional questions, please contact us:
Stock Traders DailyA Special Bonus
Find our long term observations below. Contained in this short presentation is a review of our longer term economic and market analysis. It is yours to review for free. We appreciate your interest in our firm. Our purpose is to serve you well, and this helps us start off on the right foot.
Outlook and StrategySincerely,
Thomas H. Kee Jr.
CEO, Stock Traders Daily
"; }
?>
/* ***********************************************************
page to show the messsage for stock not found
################################################################# */
function stk_not_found()
{
echo "We're sorry, the stock symbol you have entered could not be found. Please try again. Click here to go back to the input page ";
}
/* ***********************************************************
email form
################################################################# */
function form()
{
?>

Delivered to
you by Email
within seconds.
Get your free Real Time Trading Report by email Now.
It will be e-mailed to you within seconds; make sure your
information
is correct.
- Free Real Time Report
- 1 Free Report every month
- 1300 reports available on or website
- Real Time Updates available on our website
- Real Time Market Analysis on our Website
- Swing Trading Strategies > 100%
- Live Support available to our subscribers
- Automatic Trading Program available to make
trading easy.
- Give it a try by signing up for a Free Trial
right now.
- FREE TRIAL:
Free Trial
- Support:
support@stocktradersdaily.com
*privacy policy: Our Privacy
policy is to never share your personal information with anyone, for any reason whatsoever.
We want you to use our service, we don't want to sell your name! |
} ?>
/* ###########################################################################
#######################validating the input #################################
########################################################################### */
function validation()
{
global $email ;
global $name ;
global $stock ;
global $message;
$email = $_POST['email'];
$name = $_POST['name'];
$stock = $_POST['stock'];
$phone = $_POST['phone'];
if( strlen( $name ) < 1 )
{
array_push ( $message , "Name Required " ) ;
}
if( strlen( $stock ) < 1 )
{
array_push ( $message , "Stock Name Required " ) ;
}
if( strlen( $phone ) < 1 )
{
array_push ( $message , "Phone Number Required " ) ;
}
if( !check_email_address( $email ) or strlen( $email ) < 4 )
{
array_push ( $message , "Valid Email Required " ) ;// echo "------------" ;return;
}
if( !check_phone( $phone ) )
{
array_push ( $message , "Please enter a valid phone number in the correct format" ) ;// echo "------------" ;return;
}
if( ! read_stock( $stock ) )
{
array_push ( $message , "The stock symbol you have entered could not be found. Please try again. " ) ;
}
if ( count( $message ) > 0)
return false ;
else
return true ;
}
/*######################## phone ##################################*/
function check_phone($phone) {
//xxx-xxx-xxxx
if (strlen($phone) != 12) {
return false;
}
$token_array = explode("-", $phone);
if (count($token_array) != 3) {
return false;
}
if (strlen($token_array[0]) != 3) {
return false;
}
if (strlen($token_array[1]) != 3) {
return false;
}
if (strlen($token_array[2]) != 4) {
return false;
}
if (sameNumbers($token_array[0]) || sameNumbers($token_array[1]) || sameNumbers($token_array[2])) {
return false;
}
return true;
}
function sameNumbers($str) {
$chars = preg_split('//', $str, -1, PREG_SPLIT_NO_EMPTY);
$n = count($chars);
//changed on 24/04/2009
/* if (($n == 3) && ($chars[0] == $chars[1]) && ($chars[1] == $chars[2])) {
return true;
}
*/
if (($n == 4) && ($chars[0] == $chars[1]) && ($chars[1] == $chars[2]) && ($chars[2] == $chars[3])) {
return true;
}
return false;
}
/* ###########################################################################
######################### email ################################################## */
function check_email_address($email)
{
// First, we check that there's one @ symbol, and that the lengths are right
if (!ereg("^[^@]{1,64}@[^@]{1,255}$", $email))
{
// Email invalid because wrong number of characters in one section, or wrong number of @ symbols.
return false;
}
// Split it into sections to make life easier
$email_array = explode("@", $email);
$local_array = explode(".", $email_array[0]);
for ($i = 0; $i < sizeof($local_array); $i++)
{
if (!ereg("^(([A-Za-z0-9!#$%&'*+/=?^_`{|}~-][A-Za-z0-9!#$%&'*+/=?^_`{|}~\.-]{0,63})|(\"[^(\\|\")]{0,62}\"))$", $local_array[$i])) {
return false;
}
}
/* if (!ereg("^\[?[0-9\.]+\]?$", $email_array[1]))
{
// Check if domain is IP. If not, it should be valid domain name
$domain_array = explode(".", $email_array[1]);
if (sizeof($domain_array) < 2)
{
return false; // Not enough parts to domain
}
for ($i = 0; $i < sizeof($domain_array); $i++)
{
if (!ereg("^(([A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9])|([A-Za-z0-9]+))$", $domain_array[$i]))
{
return false;
}
}
} ==============================*/
return true;
}
/* #############################################################
************** testing the the stock existence ************** */
function read_stock($stocks)
{
$stk = strtoupper ( $stocks ) ;
//First check file if it exist
$filename = "../clubsite/Club2/SSD/Stocks/$stk";
// echo $filename;
//echo $filename;
if (file_exists($filename))
{
return true;
}
else
{
// @header("Location: http://www.stocktradersdaily.com/Main/monthly_pdf.php?notfound=1");
echo "" ;
exit();
}
}
//////////// ========== send_stock_reports =============////////////////
function sent_email($stocks)
{
global $email;
global $name ;
global $phone;
include_once("../clubsite/Club/pdf/gen_TradingReport.php");
//echo $stocks;
include_once("../clubsite/Club/EmailManagement/clsEmail.php");
//Start Email Sending Process
$stk = strtoupper ( $stocks ) ;
$stockfile1 = pdf_name( $stk ); // Path to the file
// echo "
-".$stockfile1."-
" ;
//return ;
if ( strlen($stockfile1) < 2 )
{
global $message ;
array_push( $message , "Unable to provide the pdf file ");
return ;
}
// $stockfile1 = $stockfile1."pdf"; // Path to the file
$mail = new mime_mail();
$attachment1 = fread(fopen("$stockfile1", "r"), filesize("$stockfile1"));
$mail->add_attachment("$attachment1", "TradingReport_".$stocks.".pdf", "Content-Transfer-Encoding: base64 /9j/4AAQSkZJRgABAgEASABIAAD/7QT+UGhvdG9zaG");
//fclose($attachment1);
// echo "
Sending email.... $stock1 ";
$mail->from = " Thomas Hill ";
$mail->headers = "Errors-To: [EMAIL=adeel.hussain@verticity.com]adeel.hussain@verticity.com[/EMAIL]";
$mail->to = $email ;
//$mail->to = "ahmedshaikhm@yahoo.com" ;//asm$
//$mail->to = "ahmedshaikhm123@aim.com" ;//asm$
//$mail->bcc = "tomkee@stocktradersdaily.com"; // ryahya@verticity.com kryahya@hotmail.com
$mail->subject = "Your $stk Report";
$mail->body = "Here is your Updated $stk Report. It has been sent as an attachment to this e-mail in PDF format. In addition, this is a trading report, not a fundamental analysis. It tells you when to make the trade, how to manage your risk, and where to take profits. It does not reflect the fundamentals of the stock. As a result, these are immediately actionable strategies.IMPORTANT! We provide risk management tools and strategies. This report is a reflection of that. However, before you read it, you should also understand the basis of our risk management techniques. This will help everyone use the attached report proactively. Here is a short presentation which helps explain our position. It includes longer term economic and market observations.
|
| The basis of our analysis. : http://stocktradersdaily.com/rulebased/player.html
"; // Message that the email has in it
$mail->send();
$mail2 = new mime_mail();
$mail2->from = " Stock Traders Daily ";
$mail2->headers = "Errors-To: [EMAIL=support@stocktradersdaily.com]support@stocktradersdaily.com[/EMAIL]";
$mail2->to = "info@stocktradersdaily.com" ;
//$mail2->to = "fleetways@gmail.com" ;
//$mail->bcc = "tomkee@stocktradersdaily.com"; // ryahya@verticity.com kryahya@hotmail.com
$mail2->subject = "requested $stk Trading Report " ;
$mail2->body = "A $stk stock report has been sent to $email User Name: $name Phone Number:$phone "; // Message that the email has in it
$mail2->send();
//End Email Sending Process
//echo "email sent";
if ( file_exists($stockfile1) )
unlink( $stockfile1 );
if ( file_exists( $stockfile1 ) )
unlink( $stockfile1 );
echo "" ;
// @header("Location: http://www.stocktradersdaily.com/Main/monthly_pdf.php?mailsent=1&stock=$stk&email=$email") ;
exit();
}
?>
|