Nesting javascript in PHP If ?
Posted: Mon Jan 25, 2010 10:08 am
Hi,
is it posible to nest simple java script in a PHP IF statment for example i have the following code:
When $row = 0 its meant to show an alert box but it dosnt work. 
is it posible to nest simple java script in a PHP IF statment for example i have the following code:
Code: Select all
if ($row == 0)
{
?>
<SCRIPT language="JavaScript">
alert('Sorry not this time, Please try again !');
</SCRIPT>
<?
}
else
{
echo $row['prize'];
}