...

View Full Version : How to link a button within an iFrame to url?



jsmin
11-01-2011, 07:09 PM
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:


<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.

marilynn.fowler
11-02-2011, 06:43 AM
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.

StadriWebmaster
11-02-2011, 02:56 PM
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?

Rowsdower!
11-02-2011, 03:59 PM
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.

jsmin
11-03-2011, 10:55 PM
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.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum