Did you mean, I cannot refer to a php variable in a javascript function?
I needed to add ";" to the code, so it didn't show a syntax error. Then I put it in the head section of the page, but it still allows the item to be put into the cart. I also tried it right after the code for the version and size selection, but that also didn't work. I don't know if adding the ";" messed it all up.
The code looks like this now:
<?php
if ($row_rspricetable['price'] == "0")
{
echo("make a selection");
}
?>
On page load, when the price is still $0, it does not display the message. I thought it might. But it would not only have to display the message but also prevent the item from being added to the cart.