Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Nov 2011
    Posts
    2
    Thanks
    3
    Thanked 0 Times in 0 Posts

    How to link a button within an iFrame to url?

    Hi, I'm new to this forum, and am also a rookie at working with HTML... I understand a lot of it, but one thing I am not too familiar with are iframes.

    Here is my situation:

    Here is my iFrame code:
    Code:
     
    <iframe frameborder="0" style="width:240px;height:230px;border:1px solid #000000;padding:0;margin:0;display:block;" scrolling="no" src="https://login.avidmobile.com/MarketingCenter2.0/widget/signup_widget.php?title=Text2Win&desc_text=Win%202%20tickets%20to%20a%20suite%20for%20the%20Florida%20Panthers&features=1&api_key=xxxxxxxxxxxxx&gid=&kid="> </iframe>
    I didn't write this... it was provided by Avid Mobile, and is a widget for my website that is SMS Mobile Marketing based. Within this iFrame is a box for someone to put their name and mobile number and a 'Sign-Up' button. right now, after they fill out the form and click "sign-up" button, it stays on the same page and just posts the words "sign up successful" under the button. What I would like to happen is... when they click Sign-Up button I would like them to be re-directed to another page within the website... a "Thank You" page. http://www.plannedgrowth.com/thank-you/ is the URL I would like them to be re-directed to.

    Can someone please show me how to code the iFrame so it will do this? Avid Mobile said they would do write the code for a fee, but they are expensive and I am hoping I can get some help with it here on this forum. Please and thank you to whoever is willing to help me.

  • #2
    Regular Coder
    Join Date
    Aug 2002
    Location
    San Francisco
    Posts
    455
    Thanks
    19
    Thanked 15 Times in 15 Posts
    A redirect can be added to a form with one line in your HTML. However, I suspect that the iframe widget is using files hosted on their site as opposed to yours, in which case you have no choice but to go through them. If you actually are hosting the files on your site, then post that code and we can look at it.
    Outside of a dog, a book is man's best friend. Inside of a dog it's too dark to read. Groucho Marx

  • Users who have thanked marilynn.fowler for this post:

    jsmin (11-03-2011)

  • #3
    New Coder
    Join Date
    Aug 2011
    Location
    NY
    Posts
    37
    Thanks
    3
    Thanked 2 Times in 2 Posts
    Redirecting to a thank you page usually does not happen on the page that contains the form; it's usually in the .cgi or .php file that is actually processing the form. Do you have access to that?

  • Users who have thanked StadriWebmaster for this post:

    jsmin (11-03-2011)

  • #4
    Senior Coder Rowsdower!'s Avatar
    Join Date
    Oct 2008
    Location
    Some say it's everything.
    Posts
    2,027
    Thanks
    5
    Thanked 397 Times in 390 Posts
    With an iframe involved the redirection is out of your hands. So in order to Remove the whole issue of whether or not you are hosting the widget yourself, you can make a PHP script to submit a form to (skipping the iframe approach entirely - you would put that "signup" form directly into your own page rather than inserting an iframe, but change the "action" attribute so that it points to your own processing script).

    Then, when a user submits the form (to you now) you can use cURL to submit that information to the widget form's original destination then let PHP "listen" for the response and grab the results of that process. If the widget submission returns a positive response then you send a header to the user redirecting them to your own "success" page.

    The only possible pitfall is that your host may not permit cURL functions. Some hosts restrict that and some don't - you would have to check with your host or (more easily) just try it out once with a basic test and see if it is enabled (or use the phpinfo() function and look for mention of the cURL library).

    It sounds worse than it really is. Implementing this would be pretty straightforward.
    The object of opening the mind, as of opening the mouth, is to shut it again on something solid. G.K. Chesterton
    See Mediocrity in its Infancy
    It's usually a good idea to start out with this at the VERY TOP of your CSS: * {border:0;margin:0;padding:0;}
    Seek and you shall find... basically:
    validate your markup | view your page cross-browser/cross-platform | free web tutorials | free hosting

  • Users who have thanked Rowsdower! for this post:

    jsmin (11-03-2011)

  • #5
    New to the CF scene
    Join Date
    Nov 2011
    Posts
    2
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Rowsdower! View Post
    With an iframe involved the redirection is out of your hands. So in order to Remove the whole issue of whether or not you are hosting the widget yourself, you can make a PHP script to submit a form to (skipping the iframe approach entirely - you would put that "signup" form directly into your own page rather than inserting an iframe, but change the "action" attribute so that it points to your own processing script).

    Then, when a user submits the form (to you now) you can use cURL to submit that information to the widget form's original destination then let PHP "listen" for the response and grab the results of that process. If the widget submission returns a positive response then you send a header to the user redirecting them to your own "success" page.

    The only possible pitfall is that your host may not permit cURL functions. Some hosts restrict that and some don't - you would have to check with your host or (more easily) just try it out once with a basic test and see if it is enabled (or use the phpinfo() function and look for mention of the cURL library).

    It sounds worse than it really is. Implementing this would be pretty straightforward.
    Even though it sounds worse than it is... it is probably still too technical for my rookie know-how. From the sounds of it, it is better for me to just rack this up as a 'can't be done'... let the pros do it, lol.

    Thanks for the time to answer this. I will share this answer with my boss and let him decide whether or not he wants me to try to tackle this or let Avid Mobile write the code.


  •  

    Posting Permissions

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