0

I can't figure out what is wrong with my PHP code, just started learning and I don't understand what is wrong. I keep getting this error: Parse error: syntax error, unexpected 'The' (T_STRING), expecting ',' or ';' in (FILE LOCATION) on line 17. Any help is greatly appreciated.

<html>
<body>
<?php
// Set the variable number
$number = $_POST["number"];
if (!empty($number))
{
        if(!is_numeric($number))              
                        {
                             echo "The value you entered is not a number. Please enter a numerical                       
                              value”;

              }
              else
             {
             if($number < 10)
    { 
        echo "The number is smaller than 10";
    }
    else if ($number >= 10 && $number <=100 )
    {
        echo "The number is between 10 and 100";
    }
    else
    {
        echo "The number is larger 100";
    }
}
}
else
{
    echo "Please enter a number";
}
?>
</body>
</html>

2 Answers2

0

This line appears to be messing things up:

echo "The value you entered is not a number. Please enter a numerical                       
                          value”;

Instead, use:

echo "The value you entered is not a number. Please enter a numerical value";
Grant Thomas
  • 44,454
  • 10
  • 85
  • 129
  • That fixed it! Thanks a bunch!!!!!!! – Cody Pasbrig Oct 07 '17 at 02:43
  • Questions that are about basic PHP syntax errors should not be answered. They should be closed as a duplicate of [PHP Parse/Syntax Errors; and How to solve them?](//stackoverflow.com/questions/18050071) only. See: [Should one advise on off topic questions?](//meta.stackoverflow.com/q/276572/1768232). Off-topic questions can be closed and deleted, which could nullify your contribution anyway. – John Conde Oct 07 '17 at 12:31
0

Just so you know what the actual problem was, you had a "smart quote" terminating your string.

The string was opened using a standard straight quote: "

but closing was attempting to be done by a curly quote:

You can see in the syntax highlighting of your question that the string wasn't being terminated correctly.

I would also think your code editor, assuming it supports syntax highlighting (which, if it doesn't, you should change to one that does) would show the same thing.

Noah Heck
  • 516
  • 6
  • 10
  • 1
    Questions that are about basic PHP syntax errors should not be answered. They should be closed as a duplicate of [PHP Parse/Syntax Errors; and How to solve them?](//stackoverflow.com/questions/18050071) only. See: [Should one advise on off topic questions?](//meta.stackoverflow.com/q/276572/1768232). Off-topic questions can be closed and deleted, which could nullify your contribution anyway. – John Conde Oct 07 '17 at 12:31