SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict
    Join Date
    Sep 2000
    Location
    Ontario, Canada
    Posts
    320
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am using Matt Wright's formmail script across a whole bunch of domain names on my server by aliasing the main CGI directory for all of them. All of the domain's don't need CGI access except for the formmail script so I just used the single script instead of a bunch of 'em. Anyways, instead of modifying the success page for each of the domain names that use the script, I was wondering if it was possible to somehow get the script to determine what host its being called from and redirect appropriately.

    So for example, I currently have something like this:

    <input type=hidden name="redirect" value="http://xyq.com/contact/success.shtml">

    I figured that something like $ENV{HTTP_REFERER} needs to go in there somewhere but I just don't know where.

    If anyone could suggest a way to do this with the Matt Wright's script or knows of a script that already does that, it would be greatly appreciated!

    Thanks.
    Jason Dulberg
    Extreme MTB
    http://extreme.nas.net

  2. #2
    SitePoint Wizard westmich's Avatar
    Join Date
    Mar 2000
    Location
    Muskegon, MI
    Posts
    2,328
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am not sure what you are asking. You have one single form page that all your domains are using. After a user fills it out successfully, you want them to be redirected to a page on the domain that they came from. You are hosting these sites on a Unix/Linux server. Is this correct?
    Westmich
    Smart Web Solutions for Smart Clients
    http://www.mindscapecreative.com

  3. #3
    SitePoint Addict
    Join Date
    Sep 2000
    Location
    Ontario, Canada
    Posts
    320
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry, should have been more descriptive. Basically, each virtual host references a single formmail.pl file and has different recipients and success url's according to which domain is refrencing the script.

    So one domain could have something like

    <FORM METHOD=POST ACTION="http://maindomain.com/cgi-bin/formmail.pl">
    <input type=hidden name="recipient" value="email@address1.net">
    <input type=hidden name="redirect" value="http://domain1.com/contact/success.shtml">

    and another

    <FORM METHOD=POST ACTION="http://maindomain.com/cgi-bin/formmail.pl">
    <input type=hidden name="recipient" value="email@address2.net">
    <input type=hidden name="redirect" value="http://domain2.com/contact/success.shtml">

    So what I am interested in doing is instead of having to hard code the "redirect" in the person's contact page, the script will determine what domain its being called from and substitute that domain into the redirect.

    So even though this won't work, it would be like

    <input type=hidden name="redirect" value="$ENV{HTTP_REFERER}/contact/success.shtml">

    Does that clear anything up at all? Let me know if you need more clarification.

    Thanks for your help!!
    Jason Dulberg
    Extreme MTB
    http://extreme.nas.net


Bookmarks

Posting Permissions

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