What are common errors that beginners encounter when writing PHP scripts, and how can they be resolved?

One common error beginners encounter is forgetting to end statements with a semicolon. This can result in syntax errors. To resolve this issue, always remember to terminate statements with a semicolon.

// Incorrect
echo "Hello, World"

// Correct
echo "Hello, World";
```

Another common mistake is using undefined variables, which can lead to runtime errors. To avoid this, make sure to define variables before using them.

```php
// Incorrect
echo $name;

// Correct
$name = "John";
echo $name;
```

Beginners often forget to include the opening and closing PHP tags `<?php` and `?>`. This can cause the script to not execute properly. Always remember to include these tags at the beginning and end of your PHP script.

```php
// Incorrect
echo "Hello, World";

// Correct
<?php
echo "Hello, World";
?>