Results 1 to 10 of 10

Thread: 100 sites feeding into one form question

  1. #1
    Join Date
    Jul 2008
    Posts
    48

    Question 100 sites feeding into one form question

    I have a lot of separate webpages and Blogs, which point to a single form. Is there anyway or technique, that can show which page or Blog was the one it was clicked from?

    I thought maybe the name of the clicked link could be incorporated into the form as a hidden field, but I have no idea how to do this.

    Any solutions would be appreciated.

    Drachsi

  2. #2
    Join Date
    Jun 2009
    Location
    Houston
    Posts
    378

    Post Re: 100 sites feeding into one form question

    You should be able to do this by passing a variable to the form via the url. On the page(s) where you call the form page, add something like this to the end of the url link.

    ?myurl=http://www.mysite.com

    This will pass a string variable to the form called myurl and it will have the value http://www.mysite.com where mysite.com is the page calling the form page.

    Then you will need a little php script on the form page to capture the variable:

    <?php
    $myurl = $_GET['myurl'];
    ?>

    This stores the string value in the php variable called $myurl.

    Then you can add a hidden field like this.

    <input type="hidden" name="my_url" value="<?php echo $myurl; ?>" />

    This will make the hidden field have the value http://www.mysite.com.

    Hope this helps.

    BTW: You will need the change the form page to have a php extension rather than an html extension so the server knows to run the php script.
    Last edited by jzieba; 06-Jul-2009 at 02:25 PM. Reason: Adding more info.

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

    Default Re: 100 sites feeding into one form question

    or just derive a field from HTTP_REFERER:
    http://www.tectite.com/fmhowto/derived.php

  4. #4
    Join Date
    Jun 2009
    Location
    Houston
    Posts
    378

    Smile Re: 100 sites feeding into one form question

    That would certainly be easier. Didn't know that was available.

    Thanks

  5. #5
    Join Date
    Jul 2008
    Posts
    48

    Unhappy Re: 100 sites feeding into one form question

    Quote Originally Posted by jzieba View Post
    You should be able to do this by passing a variable to the form via the url. On the page(s) where you call the form page, add something like this to the end of the url link.

    ?myurl=http://www.mysite.com

    This will pass a string variable to the form called myurl and it will have the value http://www.mysite.com where mysite.com is the page calling the form page.

    Then you will need a little php script on the form page to capture the variable:

    <?php
    $myurl = $_GET['myurl'];
    ?>

    This stores the string value in the php variable called $myurl.

    Then you can add a hidden field like this.

    <input type="hidden" name="my_url" value="<?php echo $myurl; ?>" />

    This will make the hidden field have the value http://www.mysite.com.

    Hope this helps.

    BTW: You will need the change the form page to have a php extension rather than an html extension so the server knows to run the php script.
    Thanks for the support. I have tried that and cannot get the reply working. The test contact page is at www.perob.com/contact-test.htm This loads the form. Completing the form post the results to a template which then sends the email to me.

    In the template I have add the field Page ID: $myurl When I get the reply this field is empty.

    Not certain what I have done wrong. I tried just having a page ID ie ?myurl=contact-test and that also did not work.

    Your advice would be very much appreciated.

    Drachsi

  6. #6
    Join Date
    Jul 2008
    Posts
    48

    Question Re: 100 sites feeding into one form question

    I forgot to post the template reply to my above post.

    Newsletter: No thanks
    Referrer: ipaddr = REMOTE_ADDR, browser = HTTP_USER_AGENT, referrer = HTTP_REFERER
    Page ID: <?php echo $myurl; ?>
    Additional Information: tested update

    So close.
    Thanks for your support
    Best Regards
    Drachsi

  7. #7
    Join Date
    Jun 2009
    Location
    Houston
    Posts
    378

    Default Re: 100 sites feeding into one form question

    For the php method, you need to change the extension of your form page from htm to php so the server knows to run the php code.

    You also need to change the link as shown below. You have the closing " in the wrong place.


    <a target="_blank" href="http://www.perob.com/technical/marke...m/contact-test?>
    Contact</a></p>

    Sorry, the text above is not pasting correctly. Your closing " needs to be after you define the variable in the url name. You have it right after marketing-support.htm.

    <a target="_blank" href=
    "http://www.perob.com/technical/marketing-support.htm?

    myurl=http://www.perob.com/contact-test">
    Contact</a></p>
    Last edited by jzieba; 10-Jul-2009 at 12:33 PM. Reason: correction

  8. #8
    Join Date
    Jun 2009
    Location
    Houston
    Posts
    378

    Post Re: 100 sites feeding into one form question

    I see where you also tried what crabtree suggested.

    Look at your html template and make sure you are really looking at $referrer and not $derive_fields.

    Referrer: $referrer

  9. #9
    Join Date
    Jul 2008
    Posts
    48

    Question Re: 100 sites feeding into one form question

    Thanks for the feedback. Yes I made a mistake and now $referrer works, but it has not solved the problem.

    To give you an example I have a page on Squidoo called "Creating Lenses" http://www.squidoo.com/creating-lenses In the text, there is a link to my form. As I have a couple of hundred pages on Squidoo, I need to know, which of my pages sent the enquiry.

    Is it possible ?

    Thanks for your tolerance and support.

    Drachsi

  10. #10
    Join Date
    Jul 2008
    Posts
    48

    Smile Re: 100 sites feeding into one form question

    Just to let you know that using your instructions that worked, many thanks, just one question in my template if I use $referrer I get the full url, is there anyway just to get the page name (like "contact testing")?

    For anybody following this thread, I did have to move the form onto Linux to run the php. So now to try it in a few Squidoo pages.

    Regards to all

    Drachsi

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Newbie question on open_basedir error
    By zenprofit in forum FormMail Subscription Support
    Replies: 14
    Last Post: 14-Feb-2005, 09:35 PM
  2. question about PHP version 4.3.8
    By djgotee in forum FormMail Subscription Support
    Replies: 4
    Last Post: 28-Nov-2004, 11:46 PM
  3. TARGET_EMAIL question
    By middleburyman in forum FormMail Subscription Support
    Replies: 1
    Last Post: 03-Sep-2004, 08:30 PM
  4. Uploading question
    By tray in forum FormMail Subscription Support
    Replies: 2
    Last Post: 11-Aug-2004, 09:31 PM
  5. at mangle / e-mail question
    By Ibis in forum FormMail Subscription Support
    Replies: 3
    Last Post: 25-Feb-2004, 02:59 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
  •