Hello everyone
I think i'm almost done with this but seem like there is some problem know i have to explain..
First of all i have This script as modules for the CMS i'm use
know know the link for each mod is
http://site.com/modules.php?modname=mailnow
it's work fine know
but after i check Send it retern me to the Same page where i have to put the info
here is what i done so far
?>
if (preg_match("/(modules\/)(.*)(index.php)/i",$PHP_SELF)) {
header("location:../../index.php");
exit;
}
<br>
<form name="msn_contacts" action="modules.php?modname=mailnow&action=send" method="post">
<input name="user_email" type="hidden" value="<?php echo $_POST['username']; ?>" >
<input name="user_pasword" type="hidden" value="<?php echo $_POST['password']; ?>" >
<table width="596" border="0" align="center" cellpadding="0" cellspacing="0" class="tblBorder1">
<!--DWLayoutTable-->
<tr>
<td height="20" valign="top" class="tbl_header_bar">Contact Email </td>
<td valign="top"><input name="chkAll" type="checkbox" id="chkAll" value="chkAll" onClick="docheckAll();"> </td>
</tr>
<?php
if ($msn->connect($username,$password))
{
// we're connected
// run rx_data function to 'idle' on the network
// rx_state will loop until the connection is dropped
$contact_list = $msn->rx_data();
$contact_num = count($contact_list);
for ($i=0; $i<$contact_num; $i++)
{
switch($_GET['action']) {
case 'send':
include('modules/modules/msninvite/mailnow.php');
break;
}
?>
Here is the Mailnow.php
<?php
if (preg_match("/(modules\/)(.*)(mailnow.php)/i",$PHP_SELF)) {
header("location:../../../index.php");
exit;
}
//========================== LOG =========================
$include_path ="/home/site/public_html/modules/mailnow/";
$fl = fopen($include_path.'mail_logs/mail_log.txt','a+');
//========= Logs ============================
$invite_contents="/Hey/";
$invite_list = $_POST['chkItem'];
$invite_count = count($invite_list);
for ($i=0; $i<$invite_count; $i++)
{
echo "<b> Inviting :</b>".$invite_list[$i]."<BR>";
mail($invite_list[$i],' Mail from !!',$invite_contents);
// Save infor of invitation mail to log file
$log_contents = "Emai: $invite_list[$i], Time: ".date('m/d/Y - H:i:s',time())."\n";
fwrite($fl,$log_contents, strlen($log_contents));
//======================= EOF logs
}
fclose($fl);
chmod($include_path."mail_logs/mail_log.txt",0775);
echo " mail Completed..............!!!!";
?>
I put All the code please take a look and tell me what i'm doing wrong ..
Thankyou 🙂