Reputation: 29
What am I doing wrong?
} else {
$output = '<script type="text/javascript">jAlert("<font color="red">'$number1'</font>", "Alert Dialog Sample")</script>';
}
I am getting:
Parse error: syntax error, unexpected T_VARIABLE
Upvotes: 0
Views: 94
Reputation: 1114
it should be like this
$output = '<script type="text/javascript">jAlert("<font color="red">'.$number1.'</font>", "Alert Dialog Sample")</script>';
}
Upvotes: 1
Reputation: 12524
You need to use the string concatenation operator.
} else {
$output = '<script type="text/javascript">jAlert("<font color="red">' . $number1 . '</font>", "Alert Dialog Sample")</script>';
}
I would refrain from using the font tag though as it is deprecated.
Upvotes: 0
Reputation: 1659
You missed the dots around $number1 which is used for concatenation
$output = '<script type="text/javascript">jAlert("<font color="red">'.$number1.'</font>", "Alert Dialog Sample")</script>';
Upvotes: 1