I have sendForm.php file, which is php using PHPMailer for sending form. In between tags there is echo and I need to use PHP variable in between tags. Is that possible somehow? I know this is too much of combining PHP and JS, but what can I do... I need a window pop-up, that's why I use also JS. The echo itself prints only to the webpage itself.
$totalSize = ($totalSize/(1024*1024));
$totalSize = round($totalSize,2);
if(!$mail->Send()) {
echo "Error sending form! You are trying to send too large files. Their size is: ", $totalSize, " MB";
echo '<script type="text/javascript">alert("Error sending form! You are trying to send too large files. Their size is: ??? ");</script>';
}
How can I print $totalSize variable inside of the JS in the place of those question marks in the 2nd echo? Thanks for your help. I'm still a beginner.
echo '<script type="text/javascript">alert("Error sending form! You are trying to send too large files. Their size is: ', $totalSize, '");</script>';, No ?Their size is: ??? ")toTheir size is: $totalSize ")