So this is the page the form is on…COULD IT BE LINE 183?
[php]<?php
session_start();
?>
<?php
//if the form button is clicked, do this stuff
if(isset($_POST['submit']))
{
//connect to the database
connection code goes here...I deleted for this post
//set up values --these sessions are pulled from login
$user_id=$_SESSION['user_id'];
$firstname=$_SESSION['firstname'];
$lastname=$_SESSION['lastname'];
$dealer=$_SESSION['dealer'];
$date = date("Y-m-d");
$callsout=$_POST['callsout'];
$textsout=$_POST['textsout'];
$emailsout=$_POST['emailsout'];
etc, etc...deleted for post here
if(
$callsout!='' &&
$textsout!='' &&
$emailsout!='' &&
etc, etc...deleted for post here
)
{
$query=mysql_query("insert into tablex values
(null,
'".$user_id."',
'".$date."',
'".$firstname."',
'".$lastname."',
'".$dealer."',
)") or die(mysql_error());
if($query)
{
echo '<center>A new record was added to the table.</center>';
echo'<center>Inserted all values</center>';
{
$to = "emailaddresseshere"; // this is recipient address
$from = $_SESSION['email']; // this is sender's email address
$firstname = $_SESSION['firstname'];//from the session
$lastname = $_SESSION['lastname'];//from the session
$subject = "Daily Form Submission";
$subject2 = "Copy of your form submission";
$message = $firstname . " " . $lastname . " submitted:
Activity
".$callsout." Calls Dialed
". $textsout." Texts Outbound
". $emailsout." Emails Sent
$message2 = "" . $first_name . "\n\n" .
$message = $firstname . " " . $lastname . " submitted:
Activity
".$callsout." Calls Dialed
". $textsout." Texts Outbound
". $emailsout." Emails Sent
$headers = $headers = 'From: t.com' . "\r\n" .
'Reply-To: [email protected]' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
$headers = $headers = 'From: tr.com' . "\r\n" .
'Reply-To: [email protected]' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
$headers2 = "From:" . $to;
$headers['Cc'] = $from;
mail($to,$subject,$message,$headers,'-f [email protected]');
//Send email to all other person of same dealer type
$query = mysql_query("SELECT email FROM users WHERE access_level='1' AND dealer='".$_SESSION['dealer']."'");
if(mysql_num_rows($query)>0) {
while($row = mysql_fetch_assoc($query)) {
// sends a copy of the message to the sender
mail($row['email'],$subject2,$message2,$headers2);
//echo $row['email'];
}
}
echo "<center>Mail Sent. Thank you " . $firstname . "!.</center>";
// You can also use header('Location: login.php'); to redirect to another page.
// You cannot use header and echo together. It's one or the other.
}
}
else
{
echo'Vaules are not inserted--there is a problem.';
}
}
else
{
echo'Inserted all values';
}
}
?>
<title>Daily Manager Log</title>
<!-- Bootstrap core CSS -->
<link href="../../dist/css/bootstrap.min.css" rel="stylesheet">
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<link href="../../assets/css/ie10-viewport-bug-workaround.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="signin.css" rel="stylesheet">
<!-- Just for debugging purposes. Don't actually copy these 2 lines! -->
<!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
<script src="../../assets/js/ie-emulation-modes-warning.js"></script>
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<?php
//session_start();
//echo "
Logged In As:
";
//foreach ($_SESSION as $key=>$val)
//echo $key." ".$val."
";
?>
<div class="container" align="center">
<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<center><h6><font color="orange">If you do not see your name below, you are not logged in. Please <a href="logout_transaction.php">Log In.</a><br></font></h6></center>
<center><font color="orange"><?php
session_start();
echo “
Logged In As:
”;
foreach ($_SESSION as $key=>$val)
echo $key." “.$val.”
";
?>
<center><h8><font color="red">Every question must be answered or the form will not submit. <br>The report information will be shared with management. </font></h8></center>
Outbound Activity
Outbound calls today.
Outbound texts today.
Sent emails today.
|
|
</div> <!-- /container -->
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<script src="../../assets/js/ie10-viewport-bug-workaround.js"></script>
[/php]