Results 1 to 3 of 3
  1. #1
    Newbie
    Join Date
    May 11th, 2005
    Posts
    8
    php redirect script of form input.
    I want to write a php script that redirects from a form on one of my web pages.

    I normally redirect a text link using "location: http:www.finallink.com/page.html" and the php "header" function.

    However I now want to redirect a form input (from a little
    CJ "buy" botton) on a page.

    I can grab the GET variables in the redirect script successfully, but I'm not sure how I emulate a redirect header for the GET input.

    The header(location: URL) normally does a 302 redirect, but then I seem to lose the GET happening.

    I'd like to be able to cope with the GETs as well as text links in my script (which pulls affiliate links from a database).

    Just to make things more complicated I've used mod_rewrite to alter www.mysite.com/product/widget.html
    to www.mysite.com/redirect?go=widget

    so I have some get variables occuring at this level as
    well. I guess I could get rid of this level of redirection
    and point the form directly at my redirection script.
    I've got it there so that the text links point to nice URLs.

    thanks,

    Crispin

  2. #2
    The Great Egress NewcastleB's Avatar
    Join Date
    January 19th, 2005
    Posts
    65
    I’m not 100% sure what you’re asking. If you’re loosing the GET information on your landing page (after the redirect), remember to append the GET info to the url in your header call. You shouldn’t be loosing the GET on your redirect page. The easiest way to do it would be to pull all the variables then call header with “location:http://www…..com?var1=$var1&so_on=$so_on”.
    But are you still master of your domain?

  3. #3
    Newbie
    Join Date
    May 11th, 2005
    Posts
    8
    I finally got it sorted - I think a nights sleep helped.

    The mod_rewrite adds a couple of GET variables and one of these needs to be stripped out of the GET array. The other is a SID, which I keep.

    Then I append all the GET variables onto my redirect URL from the GET array and do a header location. It all seems to work.

    The problem was in my programming implementation.

    Thank goodness for ethereal!

    Crispin

  4. Newsletter Signup

+ Reply to Thread

Similar Threads

  1. Help With - PHP REDIRECT
    By AddHandler in forum Programming / Datafeeds / Tools
    Replies: 3
    Last Post: March 25th, 2005, 04:43 PM
  2. PHP / MySQL Link Redirect
    By Bluesx in forum Programming / Datafeeds / Tools
    Replies: 0
    Last Post: October 20th, 2004, 01:20 PM
  3. Redirect html to php--2
    By frank3iii in forum Programming / Datafeeds / Tools
    Replies: 2
    Last Post: July 20th, 2004, 04:05 PM
  4. Redirect html to php
    By frank3iii in forum Programming / Datafeeds / Tools
    Replies: 5
    Last Post: July 19th, 2004, 08:32 PM
  5. double redirect using php?
    By moneybot in forum Programming / Datafeeds / Tools
    Replies: 1
    Last Post: May 11th, 2002, 07:26 AM

Posting Permissions

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