Kayongo Michael Ответов: 3

Php код не работает


Мой php код не работает когда я пытаюсь загрузить страницу в браузере она ничего не отображает

Что я уже пробовал:

<?php
$code ="";
$code.='<style type="text/css">
    
    body {
    overflow-x: hidden !important;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #212529;
    text-align: left;
    background-color: #fff;
}

body {
    display: block;
    margin: 8px;
}

.right {
    float: right;
}

.center {
    float: center;
    text-align: center;
    
}

.pd {
    padding-top: 50px;
}
.cl{
    color: red;
}

table {
  font-family: arial, sans-serif;
  border-collapse: collapse;
  width: 100%;
}

td, th {
  border: 1px solid #dddddd;
  text-align: left;
  padding: 8px;
}

tr:nth-child(even) {
  background-color: #dddddd;
}

.size img {
    height: 40%;
    width: 40%;
}

.red {
    color: red;
    font-size: 16px;
}

.ft {
    font-size: 16px;
}

.pt {
    padding-top: 14px;
}
    
    table tr#ROW1 {
        background-color: #99cc90;
    }

    table tr#ROW2 {
        background-color: white;
    }

    table tr#ROW3 {
        background-color: #eb3737;
    }
    table tr#ROW4 {
        background-color: #b7b7b7;
    }
  

</style>';

$code.='<body style="background-color: azure; ">';

    $code.='<section class="container" style="padding-left: 110px; padding-right: 110px; padding-bottom: 20px;">';
        $code.='<div style="padding-top: 20px;">';
            $code.='<p class="right"> URA STEER Cohort B <br>
                 HENERY K. BYENKYA <br> 28 Aril 2019
            </p>';
        $code.='</div>';
        $code.='<br>
        <br>
        <br>';

        $code.='<div class="pd">';
            $code.='<h3 class="cl"> LEADERSHIP ASSESSMENT REPORT </h3>';
            $code.='<div>';
                $code.='<div class="size">
                    <img class="size" src="images/steer.jpg" />
                </div>';
                $code.='<p>Ken Blanchard says that "Feedback is the breakfast for champions." Leaders need
                    feedback on their performance to develop. This report contains detailed, summary and
                    comparative information on how others perceive you as a leader. The foundation of this
                    assessment is a set of 40 behaviors that are closely associated with leadership success for
                    leaders at the supervisor level. It outlines your proficiency against 40 behaviours tied to
                    eight elements of leadership that are most aligned to the four dimensions of skills and
                    competences covered in the STEER program (Foundations of Leadership & Management;
                    Self Leadership; Leading Others and Leading at the Next Level). Essentially, those that you
                    selected as observers have indicated how frequently they see you engaging in these
                    behaviors. They have also provided commentary on how you have positively influenced
                    them and others, as well as how you might increase your leadership effectiveness in the
                    future. All of this is very valuable information as you consider how you can develop the
                    perspectives, competencies and approaches that will increase your effectiveness as a
                    leader. The good news is that becoming a great leader is within the grasp of all of us.</p>';
            $code.='</div>';
            $code.='<div class="row">';
                $code.='<div class="col-md-6">';
                    $code.='<p>"He is very approachable and <br> dedicated towards building self <br> reliant work teams." <br>
                        —Observer
                    </p>';
                $code.='</div>';
                $code.='<div class="col-md-6">
                    <img class="" src="images/ster.jpg" />
                </div>';
            $code.='</div>
        </div>';

        $code.='<div>
            <h4 class="ft">Report summary</h4>';
            $code.='<p>The following charts present summaries of your LAR scores. The first chart compares your
                scores (SELF) with those of the average of all observers (OTHERS).The second chart
                shows the comparison of your scores and those of the total scores received from each
                observer type. Scores range from 1 to 5. The petal graph shows a visual representation of
                how your view of your leadership proficiency compares with that of other observer types
                based on the mean of each observer type.
            </p>';
            $code.='<div style="padding-bottom: 20px;">
                <img style="width: 90%; height: 80%;" src="images/graph.JPG" />
            </div>';
            $code.='<div>';
                $code.='<table>
                    <tr>
                        <th>Self Vs Observers with Average Proficiency</th>
                        <th></th>
                        <th></th>
                        <th></th>
                        <th></th>
                        <th></th>
                    </tr>
                    <tr>
                        <td></td>
                        <td>SELF</td>
                        <td>PEERS</td>
                        <td>BOSS</td>
                        <td>DIRECT REPORT</td>
                        <td>AVG</td>
                    </tr>
                    <tr>
                        <td>Role Ownership</td>
                        <td>4.2</td>
                        <td>4.4</td>
                        <td>0.0</td>
                        <td>4.3</td>
                        <td>4.3</td>
                    </tr>
                    <tr>
                        <td>Emotional Inteligence</td>
                        <td>4.4</td>
                        <td>4.4</td>
                        <td>0.0</td>
                        <td>4.1</td>
                        <td>4.3</td>
                    </tr>
                    <tr>
                        <td>Servant Heart</td>
                        <td>4.2</td>
                        <td>3.9</td>
                        <td>0.0</td>
                        <td>4.5</td>
                        <td>4.3</td>
                    </tr>
                    <tr>
                        <td>Self Leadership</td>
                        <td>4.8</td>
                        <td>3.8</td>
                        <td>0.0</td>
                        <td>4.4</td>
                        <td>4.3</td>
                    </tr>
                </table>';
            $code.='</div>';

            $code.='<div>
                <h4>LAR Petal Graph</h4>';
                 $code.='<div style="padding-bottom: 20px; margin-left: 40px;">
                <img style="width: 70%; height: 80%;" src="images/pie.JPG" />
            </div>';
                $code.='<table>
                    <tr>
                        <th>Self Vs Others</th>
                        <th></th>
                        <th></th>
                    </tr>
                    <tr>
                        <td></td>
                        <td>Self</td>
                        <td>All Observers</td>
                    </tr>
                    <tr>
                        <td>Role Ownership</td>
                        <td>4.20</td>
                        <td>4.36</td>
                    </tr>
                    <tr>
                        <td>Emotional Inteligence</td>
                        <td>4.40</td>
                        <td>4.24</td>
                    </tr>
                    <tr>
                        <td>Servant heart</td>
                        <td>4.20</td>
                        <td>4.28</td>
                    </tr>
                    <tr>
                        <td>Self Leadership</td>
                        <td>4.80</td>
                        <td>4.16</td>
                    </tr>
                </table>';

            $code.='</div>

        </div>';

        $code.='<div class="pt">
            <h4>Part2: Detailed Report</h4>';
            $code.='<p>This table presents a ranking of all leadership behaviors according to the
                frequency these are observed (most frequent to least frequent).
            </p>';
            $code.='<table>
                <tr>
                    <th></th>
                    <th>SELF</th>
                    <th>PEERS</th>
                    <th>BOSS</th>
                    <th>DIRECT REPORT</th>
                    <th>AVG</th>
                </tr>
                <tr id="ROW1">
                    <td>Is approachable</td>
                    <td>5.0</td>
                    <td>5.0</td>
                    <td>-</td>
                    <td>4.7</td>
                    <td>4.9</td>
                </tr>
                <tr id="ROW1">
                    <td>Treats others with dignity and respect</td>
                    <td>5.0</td>
                    <td>5.0</td>
                    <td>-</td>
                    <td>4.3</td>
                    <td>4.8</td>
                </tr>
                <tr id="ROW1">
                    <td>Accepts responsibility for their work and
                        that of those they lead</td>
                    <td>5.0</td>
                    <td>5.0</td>
                    <td>-</td>
                    <td>4.3</td>
                    <td>4.8</td>
                </tr>
                <tr id="ROW2">
                    <td>Stays calm in difficult situations</td>
                    <td>5.0</td>
                    <td>4.0</td>
                    <td>-</td>
                    <td>4.7</td>
                    <td>4.6</td>
                </tr>
                <tr id="ROW4">
                    <td>Hears team concerns and shifts focus to
                        solutions.</td>
                    <td>5.0</td>
                    <td>4.0</td>
                    <td>-</td>
                    <td>4.7</td>
                    <td>4.6</td>
                </tr>
                <tr id="ROW2">
                    <td>Helps others excel in their work</td>
                    <td>5.0</td>
                    <td>4.0</td>
                    <td>-</td>
                    <td>4.7</td>
                    <td>4.6</td>
                </tr>
                <tr id="ROW3">
                    <td>Considers many options before making
                        decisions</td>
                    <td>4.0</td>
                    <td>4.0</td>
                    <td>-</td>
                    <td>4.3</td>
                    <td>4.1</td>
                </tr>
                <tr id="ROW3">
                    <td>Is sensitive to the feelings of others</td>
                    <td>4.0</td>
                    <td>4.0</td>
                    <td>-</td>
                    <td>4.3</td>
                    <td>4.1</td>
                </tr>
                <tr id="ROW3">
                    <td>Recognises his/her strengths and
                        shortcomings</td>
                    <td>4.0</td>
                    <td>4.0</td>
                    <td>-</td>
                    <td>4.3</td>
                    <td>4.1</td>
                </tr>
            </table>';

        $code.='</div>';

        $code.='<div class="pt">
            <h4>Part3: Comments and Specific Feedback</h4>';
            $code.='<p>In this section, observers have provided comments for your consideration. These highlight
                your strong areas as well as opportunities for improvement.
            </p>';
            $code.='<div>
                <p>1. What do you most appreciate about this person?</p>';
                $code.='<table>
                    <tr>
                        <td>Commits himself to exellent and timely results</td>

                    </tr>
                    <tr>
                        <td>HE IS ORAGNISED AND TAKES TIME TO ANALYSE</td>
                    </tr>
                    <tr>
                        <td>He is technically knowledgeable and approachable.</td>
                    </tr>
                    <tr>
                        <td>He is very approachable and dedicated towards building self reliant work teams.</td>
                    </tr>
                    <tr>
                        <td>He wants work to be done in time</td>
                    </tr>
                    <tr>
                        <td>I personally do self reflection to better on my leadership potentials</td>
                    </tr>
                </table>';
            $code.='</div>';
            $code.='<div class="pt">';
                $code.='<p> 2. Consider the values and day-to-day behaviors of this person. Describe how he or
                        she has impacted you and others in the organization 
                </p>';
                $code.='<table>
                    <tr>
                        <td>He has impacted me and others to do work rightly and communicate issues in time</td>

                    </tr>
                    <tr>
                        <td>He is a perfectionist and result oriented. This has enabled me become prompt at the
                            activities i undertake under his supervision such that am able to achieve the set
                            objectives within the stipulated time frames.</td>
                    </tr>
                    <tr>
                        <td>His technically knowledgeable and innovative.</td>
                    </tr>
                    <tr>
                        <td>I have had confessions of staff thanking me for providing a good example to them on
                            being open, strict with work and giving them constant feed back</td>
                    </tr>
                    <tr>
                        <td>SET A CLEAR SENSE OF REPORTING AND SHARING EXPERIENCES THAT
                            BETTER PERFORMANCE</td>
                    </tr>
                    <tr>
                        <td>The desire to excel motivates me to imitate</td>
                    </tr>
                </table>';
            $code.='</div>';
            $code.='<div class="pt">';
                $code.='<p> 3. Consider how this person leads or participates in teams. Describe how he or she has contributed to the team performance.</p>';
                $code.='<table>
                    <tr>
                        <td>CLEAR WAY OF HANDLING DUTIES HAS ASSISTED THE TEAM UNDERSTAND THESCOPE OF WORK AND BETTER REPORTING CHANNELS AND RISKS THERE IN</td>

                    </tr>
                    <tr>
                        <td>Endevors to enagege the team to find out their operational challenges</td>
                    </tr>
                    <tr>
                        <td>Great Technical experience and team leadership.</td>
                    </tr>
                    <tr>
                        <td>He has always made sure that his team accomplishes tasks in time and leads by
                            example</td>
                    </tr>
                    <tr>
                        <td>He is very social and outgoing. This has therefore led to team cohesion since he
                            galvanizes well with the team he leads.</td>
                    </tr>
                    <tr>
                        <td>I often introduce the task at hand, choose one team member to lead us through the
                            execution whilst I stand a watch to offer guidance during the course of work, as such I
                            have developed a strong team of fairly capable officers, and has helped me to grow
                            leadership skills in each of them</td>
                    </tr>
                </table>';
            $code.='</div>';
            $code.='<div class="pt">
                <p> 4. What can this person do to become more effective as a leader?</p>';
                $code.='<table>
                    <tr>
                        <td>Get more leadership courses to finetune on the few intrusic weaknesses</td>
                    </tr>
                    <tr>
                        <td>He should be more flexible and adjustable</td>
                    </tr>
                    <tr>
                        <td>Listen to staff when there is a problem</td>
                    </tr>
                    <tr>
                        <td>Need to continue daily self reflection, read more and more leadership material to grow my
                            ability to influence more members into a desired work force</td>
                    </tr>
                    <tr>
                        <td>UNDERSTAND CIRCUMSTANCES AT HAND, ABILITY TO TAKE TIMELY WELL
                            THOUGHT THROUGH DECISSIONS. OPENLY PROVIDE CONSTRUCTIVE
                            FEEDBACK TO THE TARGETED PERSONS FACE ON</td>
                    </tr>
                    <tr>
                        <td>Wear formally more often.</td>
                    </tr>
                </table>';
            $code.='</div>
        </div>';

    $code.='</section>';
$code.='</body>';
?>

F-ES Sitecore

Вы написали весь этот код за один раз, не проверив, что он работает? Если нет, вернитесь к своему последнему обновлению, которое сработало, и то, что вы сделали после этого, - это то, что ломает вещи. Или, если это вообще не ваш код, начните с пустой страницы и добавьте немного кода, и продолжайте добавлять все больше и больше кода, пока он не перестанет работать, и снова последнее, что вы добавили, это то, что сломало его.

OriginalGriff

Это не очень хороший вопрос - мы не можем понять из этого малого, что вы пытаетесь сделать.
Помните, что мы не можем видеть ваш экран, получить доступ к вашему жесткому диску или прочитать ваши мысли - мы получаем только то, что вы печатаете для работы. Таким образом, мы понятия не имеем, что вы пытались заставить его работать, что показывает ваш отладчик, какие-либо сообщения об ошибках, которые появляются ...

Используйте виджет "улучшить вопрос", чтобы отредактировать свой вопрос и предоставить более подробную информацию.

ZurdoDev

Проверьте свою консоль в браузере. Скорее всего, у вас есть проблема с синтаксисом. Но вам нужно это отладить.

3 Ответов

Рейтинг:
7

Patrice T

Цитата:
Мой php код не работает когда я пытаюсь загрузить страницу в браузере она ничего не отображает

Ваш код ведет себя не так, как вы ожидаете, или вы не понимаете, почему !

Существует почти универсальное решение: запускайте свой код на отладчике шаг за шагом, проверяйте переменные.
Отладчик здесь, чтобы показать вам, что делает ваш код, и ваша задача-сравнить с тем, что он должен делать.
В отладчике нет никакой магии, он не знает, что должен делать ваш код, он не находит ошибок, он просто помогает вам, показывая, что происходит. Когда код не делает того, что ожидается, вы близки к ошибке.
Чтобы увидеть, что делает ваш код: просто установите точку останова и посмотрите, как работает ваш код, отладчик позволит вам выполнять строки 1 на 1 и проверять переменные по мере их выполнения.

Отладчик - Википедия, свободная энциклопедия[^]

Освоение отладки в Visual Studio 2010 - руководство для начинающих[^]
Базовая отладка с помощью Visual Studio 2010 - YouTube[^]

phpdbg | php отладчик[^]
Методы отладки для PHP-программистов[^]

Отладчик здесь только для того, чтобы показать вам, что делает ваш код, и ваша задача-сравнить его с тем, что он должен делать.


Рейтинг:
23

Luc Pattyn

Очень мило, однако вы забыли основную линию

echo $code;
в самом конце

:)


Рейтинг:
15

MadMyche

Удивительный. Вы назначаете весь HTML-код в переменную $код но для кого-то это ничего не значит.
Может быть вы забыли это сделать echo() эта переменная выходит на страницу?