Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7159363
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T13:13:08+00:00 2026-05-28T13:13:08+00:00

I am working with coupon script in php. In this i have to redirect

  • 0

I am working with coupon script in php. In this i have to redirect my url 127.0.0.1/couponsite/go/1 to http://www.ebay.com and what is happening is 127.0.0.1/couponsite/go/1 redirected to 127.0.0.1/couponsite/go/1/www.ebay.com
where 1 is mapped with http://www.ebay.com
similarly 2 is mapped with http://www.someotherweb.com like this.

So i want to know in which part of my script is the error? I need help regarding this. Hope its not related to .htaccess in anyway. i have a file out.php which is handling all redirect. posting the code of out.php below.

<?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." ) ;
        }
    }

?>

Additional information: I am using Wamp

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T13:13:09+00:00Added an answer on May 28, 2026 at 1:13 pm

    Try adding a protocol (“http://”) before the address.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Working on a website http://www.ArenaText.com written in asp.net with Microsoft AJAX control toolkit. iPad
Working on a simple poker script in PHP and need a way to determine
Working on a project at the moment and we have to implement soft deletion
I know there are plugins to lazy load images. I have a coupon code
I have been working with parsing data, I got a string like: Scottish Premier
Working with a Lucene index, I have a standard document format that looks something
Working with Json, how can I NSlog only the title in this code: NSDictionary
Working with some basic java apps on CentOS 5 linux and I have my
Working with COM interop, I can call a managed function from within unmanaged code.
Working with jquery.ajax for first time... I have a class in C#: public class

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.