url扰乱了php中的布局

时间:2012-07-01 07:57:55

标签: php html layout

我在.htacess文件中发现了一个问题但不是解决方案

RewriteRule ^test/(.*)?$ findjob4.php?skills=$1
RewriteRule ^test-(.*)?$ findjob4.php?skills=$1

URL 1 : www.example.com/test-software
URL 2 : www.example.com/test/software

使用URL 2时,页面布局受到干扰,当我使用URL 1时,它运行良好(不是单个错误)。 任何人都可以告诉我,为什么以及问题是什么

刚刚添加了上面的新查询


我使用.htacess和普通网址写错误

.htacess

RewriteRule ^search-jobs/(.*)?$ findjob4.php?skills=$1

findjob4.php

<?php
    if (isset($_GET['skills']) or !empty($_GET['skills'])) {
        $d_skills = $_GET['skills'];
        $d_skills = str_replace('-', ' ', $d_skills);
    } else {
        $d_skills = ""; 
    }   
    $d_location = "texas";
    $page = 1;
?>

<?php require('header.php'); ?>

<div id="container">
    <?php  do_job_search6($d_skills, $d_location, $page); ?>
</div>
<?php require('footer.php'); ?>

现在,当我打开带有findjob4.php?skills=software完美显示布局的网址时。

其中search-jobs/software然后结果很好,但布局主要在页脚区域中分布。

当我在Developer Tools Chrome Inspect Elementconsole下使用Resource interpreted as Image but transferred with MIME type text/html: "http://localhost/example/search-jobs/software/images/loadingAnimation.gif" 时 我明白了

(anonymous function)
jQuery.Callbacks.fire
jQuery.Callbacks.self.fireWith
jQuery.extend.ready

并且这个错误是连续流动的..页脚的内容被主容器的空内容改变了..

Javascript:jquery lib错误

ROOT_URL

我有一张图片供以下参考。

IMAGE1

enter image description here

图像2

enter image description here

以下是<?php define('ROOT_DIR', dirname(__FILE__)); define('ROOT_URL', substr($_SERVER['PHP_SELF'], 0, - (strlen($_SERVER['SCRIPT_FILENAME']) - strlen(ROOT_DIR)))); ?> 常数,我用于路径。

{{1}}

1 个答案:

答案 0 :(得分:-2)

使用图像的绝对路径而不是相对路径。

<img src="http://localhost/example/images/loadingAnimation.gif" />

而不是

<img src="images/loadingAnimation.gif" />
相关问题