在此服务器上找不到请求的 URL /undefined

发布于 2024-11-03 03:28:28 字数 2356 浏览 1 评论 0原文

我有以下代码:

<a class="quickrate lightGreyBtn" href="selectmovie.php">Launch Quick Rate</a>

//this is inside my javascript
$(".lightGreyBtn").click(function() {
        $.fancybox({
               'width' : '75%',
               'height' : '75%',
               'autoScale' : false,
               'transitionIn' : 'none',
               'transitionOut' : 'none',
               'type' : 'iframe'
        });

        return false;
    });

当我单击按钮时,出现错误:

The requested URL /undefined was not found on this server.

这是我的 selectmovie.php 中的内容

<body id="quickstart">
        <div id="dialog" style="display: block;">
            <div>
                <h1><strong>Rate <span class="number">10</span> movies you like</strong> and start finding new favorites.</h1>
                <ul class="items">
                    <li data-page="1">
                        <ul class="clearfix quickstart objects">
                                <?php
                                    $db = new PDO("mysql:host=localhost;dbname=test;",'root','test');
                                    $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
                                    $db->beginTransaction();
                                    $result = $db->prepare("SELECT MID, TITLE, URL FROM movie WHERE YEAR = ? AND URL != ? ORDER BY RAND() LIMIT 8");    
                                    $result->execute(array(2011, 'http://cdn-5.nflximg.com/us/boxshots/large/70144645.jpg'));
                                    $movies = $result->fetchAll(PDO::FETCH_ASSOC); 
                                    foreach ($movies as $movie)
                                    {

                                        //create some html code using echo here
                                    }
                                ?>
                        </ul>
                    </li>
                </ul>

                <a href="#" data-page="1" data-nexttoken="1301018340333" data-total="135" data-seed="1301018340333" class="next newBlue">More Movies »</a>
            </div>
        </div>


</body>

问题是什么?

I have the following code:

<a class="quickrate lightGreyBtn" href="selectmovie.php">Launch Quick Rate</a>

//this is inside my javascript
$(".lightGreyBtn").click(function() {
        $.fancybox({
               'width' : '75%',
               'height' : '75%',
               'autoScale' : false,
               'transitionIn' : 'none',
               'transitionOut' : 'none',
               'type' : 'iframe'
        });

        return false;
    });

When I click on the button I get the error:

The requested URL /undefined was not found on this server.

Here's what I have in my selectmovie.php

<body id="quickstart">
        <div id="dialog" style="display: block;">
            <div>
                <h1><strong>Rate <span class="number">10</span> movies you like</strong> and start finding new favorites.</h1>
                <ul class="items">
                    <li data-page="1">
                        <ul class="clearfix quickstart objects">
                                <?php
                                    $db = new PDO("mysql:host=localhost;dbname=test;",'root','test');
                                    $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
                                    $db->beginTransaction();
                                    $result = $db->prepare("SELECT MID, TITLE, URL FROM movie WHERE YEAR = ? AND URL != ? ORDER BY RAND() LIMIT 8");    
                                    $result->execute(array(2011, 'http://cdn-5.nflximg.com/us/boxshots/large/70144645.jpg'));
                                    $movies = $result->fetchAll(PDO::FETCH_ASSOC); 
                                    foreach ($movies as $movie)
                                    {

                                        //create some html code using echo here
                                    }
                                ?>
                        </ul>
                    </li>
                </ul>

                <a href="#" data-page="1" data-nexttoken="1301018340333" data-total="135" data-seed="1301018340333" class="next newBlue">More Movies »</a>
            </div>
        </div>


</body>

What is the issue?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

萌梦深 2024-11-10 03:28:28

传递给 $.fancybox 的对象中没有 href 属性。尝试在 'type' : 'iframe' 之后添加此内容(当然,您还需要在 'iframe' 之后添加逗号):

'href' : $(this).attr('href')

There's no href property in the object passed to $.fancybox. Try adding this after 'type' : 'iframe' (you'll need a comma after 'iframe', too, of course):

'href' : $(this).attr('href')
溺渁∝ 2024-11-10 03:28:28

尝试使用绝对路径而不是相对路径!

尝试检查 Apache 错误日志,也许您可​​以在那里获得有关错误的更多信息。
尝试仅运行 PHP 脚本并检查是否成功!

try using absolute path instead of relative path !

try checking the Apache error log, perhaps you can get some more info about the error there.
try running only the PHP script and check if it succeed !

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文