To create a PHP script that generates a calendar view for the specified date range, you can follow these steps:

1. Create an HTML form to accept user input for start and end dates.
2. Process the submitted form data in PHP and generate the calendar view.
3. Connect to a MySQL database to store events added by users.

Here's a simple example of how this can be done:

**index.php**

```html
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Calendar</title>
    <style>
        table { width: 100%; }
        th, td { border: 1px solid black; padding: 5px; text-align: center; }
        .weekend { background-color: #f0e68c; }
    </style>
</head>
<body>
    <h1>Calendar</h1>

    <form action="calendar.php" method="post">
        <label for="start_date">Start Date:</label>
        <input type="date" name="start_date" id="start_date" required>
        <br><br>
        <label for="end_date">End Date:</label>
        <input type="date" name="end_date" id="end_date" required>
        <br><br>
        <button type="submit">Generate Calendar</button>
    </form>
</body>
</html>
```

**calendar.php**

```php
<?php
function draw_calendar($month, $year) {
    $days_in_month = cal_days_in_month(CAL_GREGORIAN, $month, $year);
    $first_day_of_month = mktime(0, 0, 0, $month, 1, $year);
    $day_of_week = date('w', $first_day_of_month);

    echo '<table>';
    echo '<tr><th colspan="7">' . date('F Y', $first_day_of_month) . '</th></tr>';
    echo '<tr><th>Sun</th><th>Mon</th><th>Tue</th><th>Wed</th><th>Thu</th><th>Fri</th><th>Sat</th></tr>';

    $day = 1;
    for ($i = 0; $i < 6; $i++) {
        echo '<tr>';
        for ($j = 0; $j < 7; $j++) {
            if (($i == 0 && $j < $day_of_week) || $day > $days_in_month) {
                echo '<td>&nbsp;</td>';
            } else {
                $class = ($j == 0 || $j == 6) ? ' class="weekend"' : '';
                echo "<td$class>$day</td>";
                $day++;
            }
        }
        echo '</tr>';
        if ($day > $days_in_month) break;
    }

    echo '</table>';
}

if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    $start_date = strtotime($_POST['start_date']);
    $end_date = strtotime($_POST['end_date']);

    if ($start_date <= $end_date) {
        $current_month = date('n', $start_date);
        $current_year = date('Y', $start_date);

        while (strtotime("$current_year-$current_month-01") <= $end_date) {
            draw_calendar($current_month, $current_year);
            echo '<br>';

            $current_month++;
            if ($current_month > 12) {
                $current_month = 1;
                $current_year++;
            }
        }
    } else {
        echo "Invalid date range.";
    }
} else {
    header('Location: index.php');
}
```

This example does not include the functionality to add events and store them in a MySQL database. You can extend this code by adding an event form for each day, processing the submitted event data, and storing it in a MySQL database using PHP's PDO or mysqli extension.

Remember that you'll need to have a MySQL server running with proper credentials and create a table to store the events.
지정된 날짜 범위에 대한 캘린더 보기를 생성하는 PHP 스크립트를 만들려면 다음 단계를 수행하면 됩니다.

1. 시작 및 종료 날짜에 대한 사용자 입력을 받는 HTML 양식을 생성합니다.
2. 제출된 양식 데이터를 PHP에서 처리하고 캘린더 보기를 생성합니다.
3. 사용자가 추가한 이벤트를 저장하기 위해 MySQL 데이터베이스에 연결합니다.

이 작업을 수행하는 방법에 대한 간단한 예는 다음과 같습니다.

**index.php**

```html
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Calendar</title>
    <style>
        table { width: 100%; }
        th, td { border: 1px solid black; padding: 5px; text-align: center; }
        .weekend { background-color: #f0e68c; }
    </style>
</head>
<body>
    <h1>Calendar</h1>

    <form action="calendar.php" method="post">
        <label for="start_date">Start Date:</label>
        <input type="date" name="start_date" id="start_date" required>
        <br><br>
        <label for="end_date">End Date:</label>
        <input type="date" name="end_date" id="end_date" required>
        <br><br>
        <button type="submit">Generate Calendar</button>
    </form>
</body>
</html>
```

**calendar.php**

```php
<?php
function draw_calendar($month, $year) {
    $days_in_month = cal_days_in_month(CAL_GREGORIAN, $month, $year);
    $first_day_of_month = mktime(0, 0, 0, $month, 1, $year);
    $day_of_week = date('w', $first_day_of_month);

    echo '<table>';
    echo '<tr><th colspan="7">' . date('F Y', $first_day_of_month) . '</th></tr>';
    echo '<tr><th>Sun</th><th>Mon</th><th>Tue</th><th>Wed</th><th>Thu</th><th>Fri</th><th>Sat</th></tr>';

    $day = 1;
    for ($i = 0; $i < 6; $i++) {
        echo '<tr>';
        for ($j = 0; $j < 7; $j++) {
            if (($i == 0 && $j < $day_of_week) || $day > $days_in_month) {
                echo '<td>&nbsp;</td>';
            } else {
                $class = ($j == 0 || $j == 6) ? ' class="weekend"' : '';
                echo "<td$class>$day</td>";
                $day++;
            }
        }
        echo '</tr>';
        if ($day > $days_in_month) break;
    }

    echo '</table>';
}

if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    $start_date = strtotime($_POST['start_date']);
    $end_date = strtotime($_POST['end_date']);

    if ($start_date <= $end_date) {
        $current_month = date('n', $start_date);
        $current_year = date('Y', $start_date);

        while (strtotime("$current_year-$current_month-01") <= $end_date) {
            draw_calendar($current_month, $current_year);
            echo '<br>';

            $current_month++;
            if ($current_month > 12) {
                $current_month = 1;
                $current_year++;
            }
        }
    } else {
        echo "Invalid date range.";
    }
} else {
    header('Location: index.php');
}
```

이 예제에는 이벤트를 추가하여 MySQL 데이터베이스에 저장하는 기능이 포함되어 있지 않습니다. 각 날짜에 대한 이벤트 양식을 추가하고, 제출된 이벤트 데이터를 처리하고, PHP의 PDO 또는 mysqli 확장을 사용하여 MySQL 데이터베이스에 저장함으로써 이 코드를 확장할 수 있습니다.

적절한 자격 증명으로 실행 중인 MySQL 서버가 있어야 하고 이벤트를 저장할 테이블을 만들어야 한다는 점을 기억하세요.