doulao2916 2014-12-12 10:45
浏览 7

发布包含../../路径的数据会给出空的$ _POST数组

Recently I moved my codeigniter website to a new server (goddady). Before this everything was working great with no problems. But now I started to get strange problems with post data, whenever I try to insert data that contains relative paths with dots (../../) and try to submit the form, I get an empty $_POST array. The strange thing is that this happens only with certain forms, not all of them. What could cause such problem?

Here is the form that causes problem:

<?php
if(isset($posts2) && count($posts2) == 1){
    $posts2 = $posts2[0];
    echo form_open_multipart('professors/update_biography/', array("id" => "professors_edit"));
        echo form_hidden('posts2[id]', $posts2->id); 
        if(isset($user) && count($user) == 1){
            $user = $user[0];
            echo form_hidden('user[id]', $user->id); 
            echo form_hidden('user[role]', "Professor"); 
        }

        ?>
        <table class="admin_table">
            <tr>
                <th>
                    Биографија
                </th>
                <td>
                    <textarea name='posts2[biography]'><?php echo $posts2->biography; ?></textarea>
                </td>
            </tr>
            <tr>
                <th>
                    Биографија EN
                </th>
                <td>
                    <textarea name='posts2[biography_en]'><?php echo $posts2->biography_en; ?></textarea>
                </td>
            </tr>
            <tr>
                <th>
                    Cv
                </th>
                <td>
                    <p class="old"><a href="<?php echo base_url()."public/uploads/pdf/".$posts2->id.'/'.$posts2->cv ?>" target="_blank">CV</a></p>
                    <input type="file" name='cv' id="pdf"></input>
                </td>
            </tr>
            <tr>
                <td>&nbsp;</td>
                <td>
                    <input type='submit' name='submit' value='Зачувај' />
                </td>
            </tr>
        </table>
        <?php 
    echo form_close();
    ?>
<div class="redButton" style="float:left; width: 150px;">
        <?php 
        if(!isset($prof[0]->id)){ //da ne go prikazuva za profesor
            echo anchor('professors/', 'Назад до професори'); 
        }
        ?>
    </div>
    <?php
}
?>
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 python的qt5界面
    • ¥15 无线电能传输系统MATLAB仿真问题
    • ¥50 如何用脚本实现输入法的热键设置
    • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
    • ¥30 深度学习,前后端连接
    • ¥15 孟德尔随机化结果不一致
    • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
    • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
    • ¥15 谁有desed数据集呀
    • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100