Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PhP Coding error #2293

Closed
EnigmaticDoctor opened this issue Mar 22, 2021 · 4 comments
Closed

PhP Coding error #2293

EnigmaticDoctor opened this issue Mar 22, 2021 · 4 comments

Comments

@EnigmaticDoctor
Copy link

EnigmaticDoctor commented Mar 22, 2021

This is my php code (error messages below this code):

<?php require_once('TickTockDB.php'); ?>

<?php
error_reporting(E_ALL);
require("phpmailertest/PHPMailer_5.2.4/class.phpmailer.php");
$breakecho = "<br />";
$space = "&nbsp;";
echo $_GET['invPath'];
echo $breakecho.'Email Address: '.$_GET['emailAddress'];
echo $breakecho.$_GET['invTotal'];
echo $breakecho.'Comments: '.$_GET['comment'];
echo $breakecho.$_GET['invDetails'];
echo $breakecho.$_GET['invPaypal'];
echo $breakecho.'Todays Date: '.$_GET['TodayDate'];
echo $breakecho.'Total Records: '.$_GET['TotalRecords'];
echo $breakecho.'New Tickets: '.$_GET['NewTickets'];
echo $breakecho.'In Progress: '.$_GET['InProgress'];
echo $breakecho.'Closed: '.$_GET['Closed'];
echo $breakecho.'No Category: '.$_GET['NoCategory'].$breakecho;
foreach ($_GET['values'] as $radnew => $value):
    echo $breakecho.$space.$radnew;
    echo $space.$value;
endforeach;
foreach ($_GET['values2'] as $radnew => $value):
    echo $breakecho.$space.$radnew;
    echo $space.$value;
endforeach;
foreach ($_GET['values3'] as $radnew => $value):
    echo $breakecho.$space.$radnew;
    echo $space.$value;
endforeach;
foreach ($_GET['values4'] as $radnew => $value):
    echo $breakecho.$space.$radnew;
    echo $space.$value;
endforeach;
foreach ($_GET['values5'] as $radnew => $value):
    echo $breakecho.$space.$radnew;
    echo $space.$value;
endforeach;
foreach ($_GET['values6'] as $radnew => $value):
    echo $breakecho.$space.$radnew;
    echo $space.$value;
endforeach;
$mystring = '';
 foreach ($_GET['values'] as $radnew => $value):
    $myString .= $breakecho . $radnew  . ":" . $space . $value;
endforeach;
$mystring2 = '';
 foreach ($_GET['values2'] as $radnew => $value):
    $myString .= $breakecho . $radnew  . ":" . $space . $value;
endforeach;
$mystring3 = '';
 foreach ($_GET['values3'] as $radnew => $value):
    $myString .= $breakecho . $radnew  . ":" . $space . $value;
endforeach;
$mystring4 = '';
 foreach ($_GET['values4'] as $radnew => $value):
    $myString .= $breakecho . $radnew  . ":" . $space . $value;
endforeach;
$mystring5 = '';
 foreach ($_GET['values5'] as $radnew => $value):
    $myString .= $breakecho . $radnew  . ":" . $space . $value;
endforeach;
$mystring6 = '';
 foreach ($_GET['values6'] as $radnew => $value):
    $myString .= $breakecho . $radnew  . ":" . $space . $value;
endforeach;


//$path = '2205-Invoice-British Friends of BAR-ILAN University-No.265-1453153496.pdf';
//$path = '../ticktockInt/documents/Invoices/PaidInvoice-Perfect Travel Ltd-No.284-1482266230.pdf';
$location = "../";
$break = "<br />";
$pound = "£";
$space = "&nbsp;";
$path = $_GET['invPath'];
$url = '';
$mailaddress = $_GET['emailAddress'];
$invdetails = $_GET['invDetails'];
$invoicetotal = $_GET['invTotal'];
$inventas = 'http:https://www.inventas.co.uk';
$comment = $_GET['comment'];
$todaydate= $_GET['TodayDate'];
$totaltickets= $_GET['TotalRecords'];
$newtickets= $_GET['NewTickets'];
$inprogress= $_GET['InProgress'];
$closed= $_GET['Closed'];
$nocategory= $_GET['NoCategory'];
$supportwebsite= 'http:https://ticktockit.dyndns.biz:888/inventassites';
$name= 'test.pdf';
$encoding = 'base64';
$type = 'application/pdf';
$mail = new PHPMailer;
//$mail->IsSMTP();
//$mail->CharSet = 'UTF-8';
//$mail->Encoding = 'base64';
$mail->setFrom('[email protected]', 'TickTockIT');
$mail->addAddress($mailaddress, 'My Contact');
//$mail->addAddress('[email protected]', 'My Contact');
//$mail->addStringAttachment(file_get_contents($path), 'invoice.pdf');
//$mail->addAttachment($path, $name, $encoding, $type);
//$mail->addStringAttachment($path, $name, $encoding, $type);
$mail->addAttachment($path);
$mail->AddEmbeddedImage('images/favicon.png', 'InventasImage');
$mail->AddEmbeddedImage('', 'pplogo');
$mail->AddEmbeddedImage('images/icon.jpg', 'ttheader');
$mail->AddEmbeddedImage('images/favicon.png', 'ttheader');
$mail->Subject  = 'Inventas Ticket Matrics';
$mail->Body = $Body;
$mail->IsHTML(true);
$mail->Body = 'Ticket Metrics and Attached PDF:
'.$break.$break.'Ticket Metrics Date (All Tickets to Date):'.$space.$todaydate.'
'.$break.'Ticket Metrics (Agent Reference):'.'
'.$break.'<font color="purple">'.$myString.'</font>'.'
'.$break.$myString2.'
'.$break.'Total Tickets:'.$space.$totaltickets.'
'.$break.'New Tickets:'.$space.$newtickets.'
'.$break.'In Progress:'.$space.$inprogress.'
'.$break.'Closed:'.$space.$closed.'
'.$break.'No Category:'.$space.$nocategory.'
'.$break.$break.'Message:'.$space.''.$comment.'
'.$break.$break.'Details:'.$invdetails.'
'.$break.$break.'For Inventas:'.$space.$paypal.'
'.$break.$break.'<img src="cid:ttheader" />
'.$break.'<a href='.$inventas.' style="text-decoration:none"><p style="font-size:30px; color: #808080">Click Here to go to Inventas web page  <img src="cid:InventasImage" /></p></a>
'.$space.'(Guest Account may be Required)
'.$break.'<a href='.$supportwebsite.' style="text-decoration:none"><p style="font-size:30px; color: #808080">Click Here to go to the Support Website <img src="cid:InventasImage" /></p></a>
'.$space.'(Guest Account may be Required)';
if(!$mail->send()) {
  echo 'Message was not sent.';
  echo 'Mailer error: ' . $mail->ErrorInfo;
} else {
  echo $breakecho.$breakecho.'Message has been sent.';
}
?>

Error Messages:

Notice: Undefined index: invPath in /storage/emulated/0/htdocs/inventas/sites/emailedforms/status_emails.php on line 8

Email Address: [email protected]
Notice: Undefined index: invTotal in /storage/emulated/0/htdocs/inventas/sites/emailedforms/status_emails.php on line 10


Comments: comments
Notice: Undefined index: invDetails in /storage/emulated/0/htdocs/inventas/sites/emailedforms/status_emails.php on line 12


Notice: Undefined index: invPaypal in /storage/emulated/0/htdocs/inventas/sites/emailedforms/status_emails.php on line 13


Todays Date: 19/03/2021 10:06:05 pm
Total Records: 92
New Tickets: 40
In Progress: 16
Closed: 10
No Category: 1

 'BV: New Ticket' 33
 'BV: In Progress' 13
 'BV: Closed' 8
Notice: Undefined index: values2 in /storage/emulated/0/htdocs/inventas/sites/emailedforms/status_emails.php on line 24

Warning: Invalid argument supplied for foreach() in /storage/emulated/0/htdocs/inventas/sites/emailedforms/status_emails.php on line 24

Notice: Undefined index: values3 in /storage/emulated/0/htdocs/inventas/sites/emailedforms/status_emails.php on line 28

Warning: Invalid argument supplied for foreach() in /storage/emulated/0/htdocs/inventas/sites/emailedforms/status_emails.php on line 28

Notice: Undefined index: values4 in /storage/emulated/0/htdocs/inventas/sites/emailedforms/status_emails.php on line 32

Warning: Invalid argument supplied for foreach() in /storage/emulated/0/htdocs/inventas/sites/emailedforms/status_emails.php on line 32

Notice: Undefined index: values5 in /storage/emulated/0/htdocs/inventas/sites/emailedforms/status_emails.php on line 36

Warning: Invalid argument supplied for foreach() in /storage/emulated/0/htdocs/inventas/sites/emailedforms/status_emails.php on line 36

Notice: Undefined index: values6 in /storage/emulated/0/htdocs/inventas/sites/emailedforms/status_emails.php on line 40

Warning: Invalid argument supplied for foreach() in /storage/emulated/0/htdocs/inventas/sites/emailedforms/status_emails.php on line 40

Notice: Undefined variable: myString in /storage/emulated/0/htdocs/inventas/sites/emailedforms/status_emails.php on line 46

Notice: Undefined index: values2 in /storage/emulated/0/htdocs/inventas/sites/emailedforms/status_emails.php on line 49

Warning: Invalid argument supplied for foreach() in /storage/emulated/0/htdocs/inventas/sites/emailedforms/status_emails.php on line 49

Notice: Undefined index: values3 in /storage/emulated/0/htdocs/inventas/sites/emailedforms/status_emails.php on line 53

Warning: Invalid argument supplied for foreach() in /storage/emulated/0/htdocs/inventas/sites/emailedforms/status_emails.php on line 53

Notice: Undefined index: values4 in /storage/emulated/0/htdocs/inventas/sites/emailedforms/status_emails.php on line 57

Warning: Invalid argument supplied for foreach() in /storage/emulated/0/htdocs/inventas/sites/emailedforms/status_emails.php on line 57

Notice: Undefined index: values5 in /storage/emulated/0/htdocs/inventas/sites/emailedforms/status_emails.php on line 61

Warning: Invalid argument supplied for foreach() in /storage/emulated/0/htdocs/inventas/sites/emailedforms/status_emails.php on line 61

Notice: Undefined index: values6 in /storage/emulated/0/htdocs/inventas/sites/emailedforms/status_emails.php on line 65

Warning: Invalid argument supplied for foreach() in /storage/emulated/0/htdocs/inventas/sites/emailedforms/status_emails.php on line 65

Notice: Undefined index: invPath in /storage/emulated/0/htdocs/inventas/sites/emailedforms/status_emails.php on line 76

Notice: Undefined index: invDetails in /storage/emulated/0/htdocs/inventas/sites/emailedforms/status_emails.php on line 79

Notice: Undefined index: invTotal in /storage/emulated/0/htdocs/inventas/sites/emailedforms/status_emails.php on line 80

Notice: Undefined variable: Body in /storage/emulated/0/htdocs/inventas/sites/emailedforms/status_emails.php on line 109

Notice: Undefined variable: myString2 in /storage/emulated/0/htdocs/inventas/sites/emailedforms/status_emails.php on line 115

Notice: Undefined variable: paypal in /storage/emulated/0/htdocs/inventas/sites/emailedforms/status_emails.php on line 123

Deprecated: Function get_magic_quotes_runtime() is deprecated in /storage/emulated/0/htdocs/inventas/sites/emailedforms/phpmailertest/PHPMailer_5.2.4/class.phpmailer.php on line 1856

Deprecated: Function get_magic_quotes_runtime() is deprecated in /storage/emulated/0/htdocs/inventas/sites/emailedforms/phpmailertest/PHPMailer_5.2.4/class.phpmailer.php on line 1856
Message was not sent.Mailer error: Could not instantiate mail function.
@Synchro
Copy link
Member

Synchro commented Mar 22, 2021

The very first thing the issue template (which you deleted, twice) says is that you should ensure you're using the latest version. You're using a very old version that's both buggy and vulnerable to attack, so you need to upgrade immediately.

The important part of your error output (if you can ignore all the basic coding errors) is:

Could not instantiate mail function

The next thing the template says is that you should read the troubleshooting guide, which covers this exact problem.

@Synchro Synchro closed this as completed Mar 22, 2021
@EnigmaticDoctor
Copy link
Author

EnigmaticDoctor commented Mar 22, 2021 via email

@Synchro
Copy link
Member

Synchro commented Mar 22, 2021

No problem – it was that when you create a ticket to report a problem, it contains some default text that covers some things you can do to investigate your problem, including a link to the same documentation I gave you. You could have got there quicker, and without my involvement, by reading what was in front of you, which is why it's there. It also provides an outline of how to describe your problem so it's easier for maintainers to respond to or fix. Just deleting it all is unhelpful.

@EnigmaticDoctor
Copy link
Author

EnigmaticDoctor commented Mar 22, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants