示例#1
0
<section>
    <h2>Challenges</h2>
    <table id="challenges">
        <thead>
            <tr>
                <td>Title</td>
                <td># Solves</td>
                <td>Points</td>
            </tr>
        </thead>
        <tbody>
            <?php 
foreach ($chals as $chal) {
    ?>
                <tr<?php 
    if (is_solved($chal->id)) {
        echo ' class="solved"';
    }
    ?>
>
                    <td><a href="?p=chal&amp;id=<?php 
    echo $chal->id;
    ?>
">
                        <?php 
    echo $encode($chal->title);
    ?>
                    </a></td>
                    <td><?php 
    echo $encode($chal->solved);
    ?>
示例#2
0
echo $encode(urlencode($_GET['id']));
?>
" method="post">
        <fieldset>
            <legend>
                <h2><?php 
echo $encode($chal->title);
?>
</h2>
            </legend>
            <h4><?php 
echo $encode($chal->points);
?>
 Points</h4>
            <?php 
if (is_solved($chal->id) && !is_bool($valid_flag)) {
    ?>
                <div class="important">Already solved.</div>
            <?php 
}
?>
            <div class="main-text">
                <?php 
/* "vulnerable" to xss by purpose */
?>
                <?php 
echo $chal->desc;
?>
            </div>
            <?php 
if (is_bool($valid_flag)) {