I have the below section of code where I want to display how many orders have been added if conditions of the $orderstat are met. The alert works but not with the $orderstat variable inside it. Can anyone see what I am doing wrong? Thanks in advance!
session_start();
$orderstat = $_SESSION['orderstat'];
if ( $orderstat == "1" || $orderstat == "2" || $orderstat == "3" || $orderstat == "4") {
echo '<script language="javascript">';
**echo 'alert('<?php echo $orderstat; ?>' + "order/s successfully added to Job")';**
echo '</script>';
}
session_destroy();
Change this line echo 'alert('<?php echo $orderstat; ?>' + "order/s successfully added to Job")';
to
echo 'alert("'.$orderstat.' order/s successfully added to Job")';
You are nesting the php again and again in line echo 'alert('' + "order/s successfully added to Job")';
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다