Results 1 to 4 of 4

Thread: Passing Variable through Good_URL (Thank You Page)

  1. #1
    Join Date
    Jun 2009
    Posts
    2

    Question Passing Variable through Good_URL (Thank You Page)

    I just want to pass a PHP variable through the good_url page, like this:

    <input type="hidden" name="good_url" value="http://www.example.com/thankyou.php?MY_VARIABLE=<?php echo $MY_VARIABLE; ?>" />

    This variable IS coming from the user's input in the form, so it needs to POST to formmail, and then GET from the thank you page so that I can do special actions based on the variable.

    The input field in the form looks like this:

    <input type="radio" name="MY_VARIABLE" value="Testing" />

    Any help would be appreciated!

  2. #2
    Join Date
    Mar 2004
    Posts
    2,224

    Default Re: Passing Variable through Good_URL (Thank You Page)

    getting submitted fields to be accessed from another php script used to be very hard to do

    however i noticed a recent version of formmail introduced this new config:
    http://www.tectite.com/fmdoc/session_access.php

    in ur formmail config:
    PHP Code:
    $SESSION_ACCESS = array("MY_VARIABLE"); 
    in ur html:
    HTML Code:
    <input type="radio" name="MY_VARIABLE" value="Testing" />
    ur thankyou.php can then access MY_VARIABLE via the session:
    PHP Code:
    $MY_VARIABLE $_SESSION["MY_VARIABLE"]; 
    if ur thankyou.php absolutely needs to have it as a GET (i.e. part of the url), then youll need to derive ur good_url field...post back if u need help with that: http://www.tectite.com/fmhowto/derived.php

  3. #3
    Join Date
    Feb 2007
    Posts
    162

    Default Re: Passing Variable through Good_URL (Thank You Page)

    Another way to do what you want to do would be to use cURL to post to formmail, and when cURL returns data, output it inside your confirmation page. Just because formmail can redirect to a good url or bad url doesn't mean that your site visitor has to go to either of these pages. For instance, good_url may just return a (int)1, while bad_url may just return (int)0. You can have php check for the returned value, and do whatever you desire with the posted data (because you haven't left the page that posted via cURL to formmail).

  4. #4
    Join Date
    Jun 2009
    Posts
    2

    Smile Re: Passing Variable through Good_URL (Thank You Page)

    Thank you very much for all of your responses! I ended up using the method of deriving the good_url field. Here's how I did it:

    HTML Code:
    <input type="hidden" name="good_url" value="http://www.example.com/thankyou.php?MY_VARIABLE=" />
    and:

    HTML Code:
    <input type="hidden" name="derive_fields" value="good_url=good_url+MY_VARIABLE" />
    with the same input field as before in the form:

    HTML Code:
    <input type="radio" name="MY_VARIABLE" value="Testing" />

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. good_url
    By Allen in forum FormMail Subscription Support
    Replies: 2
    Last Post: 22-Feb-2005, 10:25 PM
  2. good_url problem
    By darren777 in forum FormMail Subscription Support
    Replies: 2
    Last Post: 20-Jan-2005, 09:47 AM
  3. good_url problem
    By iankx in forum FormMail Subscription Support
    Replies: 3
    Last Post: 18-May-2004, 04:46 AM
  4. good_url
    By aloneranger in forum FormMail Subscription Support
    Replies: 5
    Last Post: 21-Jan-2004, 06:30 PM
  5. GOOD_URL COMMAND IN FORMMAIL.PHP
    By Paul Ovens in forum FormMail Subscription Support
    Replies: 3
    Last Post: 19-Jan-2004, 04:29 AM

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
  •