Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
Old 06-24-2006, 09:29 AM Godaddy gdform.
Junior Talker

Posts: 2
Trades: 0
I use godaddy linux hosting.

I have setup form mailer and directed my form to the file

/cgi/gdform.cgi

The form is working but after the form is submited the user is sent back to the home page. I want to direct them to a diffrent page which states the message has been sent. There is no option in my hosting account to change this, godaddy did tell me it is possible but couldnt help me further.

I just want to know if i can adjust anything in this script to point to a certain url once the form is submited

Thanks

Code:
#!/usr/bin/perl
sub parse_form_data
{
    local (*FORM_DATA) = @_;
    local  ( $request_method, $query_string, @key_value_pairs, $key_value, $key, $value);
    $request_method = $ENV{'REQUEST_METHOD'};
    if ($request_method eq "GET") {
        $query_string = $ENV{'QUERY_STRING'};
    } elsif ($request_method eq "POST") {
        read (STDIN, $query_string, $ENV{'CONTENT_LENGTH'});
    };
    @key_value_pairs = split(/&/, $query_string);
    foreach $key_value (@key_value_pairs) {
        ($key, $value) = split (/=/, $key_value);
        if (defined($value)) {$value =~ tr/+/ /;
            $value =~ s/%([\dA-Fa-f][\dA-Fa-f])/pack ("C", hex ($1))/eg;};
        if (defined($FORM_DATA{$key})) {
            $FORM_DATA{$key} = join (" ", $FORM_DATA{$key}, $value);
        } else {
            $FORM_DATA{$key} = $value;
        }
    }
}; # end of sub
&parse_form_data(*simple_form);
$t = time;
chdir ($ENV{'DOCUMENT_ROOT'}) ; chdir("..");
open (OUTFILE, ">data/gdform_$t") or die ("Cannot open file");
while (($key , $value) = each(%simple_form)) {
  print OUTFILE "<GDFORM_VARIABLE NAME=$key START>\n";
  print OUTFILE "$value\n";
  print OUTFILE "<GDFORM_VARIABLE NAME=$key END>\n";
  if ($key eq "redirect") { $landing_page = $value;}
}
close (OUTFILE);
if ($landing_page ne "") {
  print "Location: http://$ENV{'HTTP_HOST'}/$landing_page\n\n";
} else {
  print "Location: http://$ENV{'HTTP_HOST'}/\n\n";
}
luckylukz is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Reply     « Reply to Godaddy gdform.
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.13922 seconds with 12 queries