-2

I am getting the syntax error commented code. Can some have idea, why this error comes

Error: syntax error, unexpected T_STRING, expecting ',' or ';'

echo '<script>
    alert("Case successfully assigned!");
    window.location.href="casedetails.php?caseid=".$row['case_id']."&&msg=added ";
    </script>';
aquilina
  • 15
  • 1
  • 5

3 Answers3

0

Use single quotes to open and close. Don't mix it : Try this

echo '<script>
    alert("Case successfully assigned!");
    window.location.href="casedetails.php?caseid='.$row['case_id'].'&&msg=added";
    </script>';
arisalsaila
  • 429
  • 2
  • 7
0

You need to concatenate properly, you started with single quotes...try

echo '<script>
alert("Case successfully assigned!");
window.location.href="casedetails.php?caseid='.$row['case_id'].'&msg=added";
</script>';
Saad Imran.
  • 4,480
  • 2
  • 23
  • 33
0

you need to use the single quotes and single & like :

'.$row['case_id'].'&msg=added"

J. Zend
  • 88
  • 7