“there Is A Syntax Error On Lines 14, 21 And 25. Code Hitting May Not Work Until You Fix This Error”?

This it my first time looking a php, and I am recieving the error message “There is a syntax error on lines 14, 21 and 25. Code hitting may not work until you fix this error”. I am also getting “Dynamically-related files cannot be discovered, because there is no site definition for this document”. What does this mean (i’m really new to all this)?! The php is below (it’s just a simple file I made, to decide wether someone is eligible for a discount, given their age. Many thanks.
65)
{
$discount = .90 ;
print “you have received our seniors discount, your price is \’a3” $price-$discount ;
}
else
{
if ($age
}

Both comments and pings are currently closed.

2 Responses to ““there Is A Syntax Error On Lines 14, 21 And 25. Code Hitting May Not Work Until You Fix This Error”?”

  1. ? says:

    Try this.
    < ?php $price = 3.00 ; if ($age >65)
    {
    $discount = .90 ;
    print “you have received our seniors discount, your price is ‘a3” $price-$discount ;
    }
    else
    {
    if ($age <18)
    $discount = .95 ;
    print "you have received our juniors discount, your price is 'a3" $price-$discount ;
    }
    else
    {
    print "Sorry, you do not qualify for a discount. Your price is $" $price ;
    }
    ?>
    Also. The dynamically related file might be a connection file, for example to connect to a database, it just means it can’t be found on your computer, however this is nothing to worry about as php scripts won’t work on your computer anyway without using XAMPP and i assume you’ll be uploading these files to a web server.

  2. Valentin says:

    1. You should use echo here, instead of print. Use print if you need to capture a return value. Here, you don’t.
    2. You need to concatenate your variables to the echoed strings with the concatenation operator (a period). It looks like this:
    echo ‘Sorry, you do not qualify for a discount. Your price is $’.$price;

Powered by WordPress | Designed by: free css template | Thanks to hostgator coupon and web hosting reviews