Results 1 to 4 of 4

Thread: Redirect issues

Threaded View

  1. #1
    Join Date
    Apr 2004

    Redirect issues

    Here is what i am trying to do:

    Step One:
    A user clicks a link on my wordpress page, they will get redirected to my geo-redirect code (although i think it is not working as it only identifies if US, and nothing else anymore, but that is another problem for another day)

    The link that they click has a custom identifier ?name=XXX

    Step Two:
    Go to redirect page, re-direct page will then grab the 'name' and if user is in US will send them to google.com

    but if anywhere else in world they will get sent to another website that needs that custom identifier. and it is here where my code crashes

    check out my code on the php detect/redirect page:

    PHP Code:

    $geocode_op = @file_get_contents ("http://api.ipinfodb.com/v3/ip-country/?key=4b0967a55992ecea5b6672aff5f2bbbf41eda3fd04e98a18a9c98b6a5c5d5221&ip=$_SERVER[REMOTE_ADDR]&format=json");

    $geocode_op json_decode ($geocode_op);

    $country_code $geocode_op->countryCode;

    if (
    $country_code == 'US') {
    header('Location: http://www.google.com');

    else if (
    $country_code == 'UK') {
    header('Location: http://www.XXXX.com/link.php?name='  $name);

    else {
    header('Location: http://www.XXXX.com/link.php?name=?name='  $name);
    ANy ideas why this is crashing

    PS. Oh btw if i don;t try to capture the $name and move it to the next page, code will work...
    Last edited by Athmaus; 10-02-2013 at 11:39 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center