Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用PHP优惠券网站脚本工作:PHP中的重定向错误_Php_.htaccess_Redirect_Wamp - Fatal编程技术网

使用PHP优惠券网站脚本工作:PHP中的重定向错误

使用PHP优惠券网站脚本工作:PHP中的重定向错误,php,.htaccess,redirect,wamp,Php,.htaccess,Redirect,Wamp,我正在使用php中的优惠券脚本。在此情况下,我必须将我的url 127.0.0.1/couponsite/go/1重定向到www.ebay.com,现在发生的是将127.0.0.1/couponsite/go/1重定向到127.0.0.1/couponsite/go/1/www.ebay.com 其中1与www.ebay.com映射 类似地,2与www.someotherweb.com映射如下 所以我想知道脚本的哪一部分是错误?在这方面我需要帮助。希望它与.htaccess无关。我有一个out.

我正在使用php中的优惠券脚本。在此情况下,我必须将我的url 127.0.0.1/couponsite/go/1重定向到www.ebay.com,现在发生的是将127.0.0.1/couponsite/go/1重定向到127.0.0.1/couponsite/go/1/www.ebay.com 其中1与www.ebay.com映射 类似地,2与www.someotherweb.com映射如下

所以我想知道脚本的哪一部分是错误?在这方面我需要帮助。希望它与.htaccess无关。我有一个out.php文件,它处理所有重定向。在下面发布out.php的代码

<?php

    if ( intval ( $qstring[1] ) < 0 )
        exit( "No coupon selected." );

    if ( $web == "Website" )
    {
        $web = $data->select ( "Website" , "*" , array ( "WebsiteID" => intval ( $qstring[1] ) ) ) ;
        $web = $web[0] ;

        if ( ! empty ( $web ) )
        {
            $data->update ( "Website" , array ( "Views" => intval ( $web["Views"] ) + 1 ) , array ( "WebsiteID" => intval ( $web["WebsiteID"] ) ) ) ;
            header ( "location:".$web["AffilateURL"] ) ;
            exit();
        }
        else
        {
            exit ( "Website not found. " ) ;
        }
    }
    elseif ( $tag == "Tag" )
    {
        $offer_id = $qstring[1] ;

        $offer = $data->select ( "Tag_Offers" , "*" , array ( "Tag_OffersID" => intval ( $offer_id ) ) ) ;
        $offer = $offer[0] ;
        if ( ! empty ( $offer ) )
        {
            header ( "location:".$offer["LandingPage"] ) ;
            exit ( ) ;
        }
        else
        {
            exit ( "Offer not found" ) ;
        }
    }
    elseif ( $tag == "WOffer" )
    {
        $offer_id = $qstring[1] ;

        $offer = $data->select ( "Website_Offers" , "*" , array ( "Website_OffersID" => intval ( $offer_id ) ) ) ;
        $offer = $offer[0] ;
        if ( ! empty ( $offer ) )
        {
            header ( "location:".$offer["LandingPage"] ) ;
            exit ( ) ;
        }
        else
        {
            exit ( "Offer not found" ) ;
        }
    }
    else
    {
        $coupon_id = $qstring[1] ;

        $coupon = $data->select ( "Coupon" , "*" , array ( "CouponID" => intval ( $qstring[1] ) ) ) ;
        $coupon = $coupon[0] ;
        if ( ! empty ( $coupon ) )
        {
            $web = $data->select ( "Website" , "*" , array ( "WebsiteID" => intval ( $coupon["WebsiteID"] ) ) ) ;
            $web = $web[0] ;

            if ( ! empty ( $web ) )
            {
                $data->update ( "Website" , array ( "Views" => intval ( $web["Views"] ) + 1 ) , array ( "WebsiteID" => intval ( $coupon["WebsiteID"] ) ) ) ;
                header ( "location:".$web["AffilateURL"] ) ;
                exit();
            }
            else
            {
                exit ( "Website not found." ) ;
            }
        }
        else
        {
            exit ( "Coupon not found." ) ;
        }
    }

?>


附加信息:我正在使用Wamp

尝试在地址之前添加一个协议(“http://”)。

谁写过这篇文章不是一个好的php开发人员。如果你这样回答就好了?标题(“位置:”“http://.$offer[“LandingPage”]”);或标题(“位置:http://.$offer[“LandingPage”]”);标题('Location:http://.$offer['LandingPage']);他应该工作。或者只是确保$offer['LandingPage']中包含协议(“)。