I am trying to perform a form function but keep getting error

I am running wampserver 2.0 as my virtual server. keep getting this error.

Parse error: syntax error, unexpected $end in C:\wamp\www\formexercise1.php on line 3

Here is my code:

  1. FORM EXERCISE 1

15.
16.
17.
18.
19.
20. <?PHP
21.
22. $firstname=($_POST[‘firstname’]);
23. $lastname=($_POST[‘lastname’]);
24.
25. if (isset($_POST[‘Submit1’])) {
26.
27. echo($firstname . $lastname)
28.
29.
30.
31. ?>
32.
33.
34.

You have an opening parenthesis, but no closing one:

[php]
if (isset($_POST[‘Submit1’]))
{
echo($firstname . $lastname);
} <—
[/php]

Also, make sure you put a ; after your echo statement.

Sponsor our Newsletter | Privacy Policy | Terms of Service