| | #1 |
| Warrior Member Join Date: 2012 Location: Scotland
Posts: 25
Thanks: 24
Thanked 1 Time in 1 Post
|
Hi There, I was wondering if any of you code guru's out there can work this out. Or even has a solution? I need to be able to dynamically change the values in an aweber optin form from an independant file. For example the following html code: <input type="hidden" name="meta_web_form_id" value="FORMIDVALUEHERE" /> <input type="hidden" name="meta_split_id" value="" /> <input type="hidden" name="listname" value="LISTNAMEHERE" /> <input type="hidden" name="redirect" value="URLREDIRECTHERE" /> <input type="hidden" name="meta_adtracking" value="LISTNAME" /> <input type="hidden" name="meta_message" value="1" /> <input type="hidden" name="meta_required" value="email" /> Has capitalised values that I need to be able update dynamicaly from a very simple text file that the HTML code refers to. So the text file would be like this Simpletextfile that can be edited easily. FORMIDVALUEHERE LISTNAMEHERE URLREDIRECTHERE LISTNAME And all this can be done without even opening an HTML file. ![]() Can this be done? Iain |
|
Iain Howard http://answertobiz.co.uk Last edited on 2nd Mar 2014 at 11:09 AM. Reason: typo | |
| |
| | #2 |
| Advanced Warrior War Room Member Join Date: 2006 Location: USA
Posts: 1,907
Thanks: 236
Thanked 1,377 Times in 676 Posts
|
Easiest way would be to put your list values in a PHP file (just give your text file a PHP extension), and then create a variable for each value, like... $form = "FORMIDVALUEHERE"; $listname = "LISTNAMEHERE"; $url = "URLREDIRECTHERE"; etc. etc. Then "include" that PHP file first thing on your opt-in page, like... <?php include('listfile.php'); ?> Your opt-in page will need to have a PHP extension as well (ie optin.php). Then anywhere on your optin page that you want to display a list value, you would use <?php echo $variableName; ?>. For example... <input type="hidden" name="meta_web_form_id" value="<?php echo $form; ?>" /> Alternately, you could use Javascript / jQuery to accomplish basically the same thing, but PHP would be the most reliable way to do it, since a tiny percentage of your visitors may have JS disabled. Let me know if you have any questions. |
| | |
| |
| The Following User Says Thank You to Brandon Tanner For This Useful Post: |
| | #3 |
| Warrior Member Join Date: 2012 Location: Scotland
Posts: 25
Thanks: 24
Thanked 1 Time in 1 Post
|
Thanks Brandon! I will give that a try and let you know how I get on. Iain |
|
Iain Howard http://answertobiz.co.uk | |
| |
| | #4 |
| Warrior Member Join Date: 2012 Location: Scotland
Posts: 25
Thanks: 24
Thanked 1 Time in 1 Post
|
Hi Brandon, This is what I have in my index.php file: Above the header I have: <?php include('listfile.php'); ?> <head profile="http://gmpg.org/xfn/11">....... and so on..... At the optin area I have the following: <input type="hidden" name="meta_web_form_id" value="<?php echo $form; ?>" /> <input type="hidden" name="meta_split_id" value="" /> <input type="hidden" name="listname" value="<?php echo $listname; ?>" /> <input type="hidden" name="redirect" value="<?php echo $url; ?>" /> and so on..... In the listfile.php I have the following values: $form = "342767906"; $listname = "hbblist-10000"; $url = "http://www.aweber.com/thankyou.htm?m=default"; But when I try to subscribe aweber is telling me list not active! Have I missed somthing? Iain |
|
Iain Howard http://answertobiz.co.uk | |
| |
| | #5 |
| Advanced Warrior War Room Member Join Date: 2006 Location: USA
Posts: 1,907
Thanks: 236
Thanked 1,377 Times in 676 Posts
|
Forgot to mention that you need to put opening and closing PHP tags in your list file. For example... <?php $form = "342767906"; $listname = "hbblist-10000"; $url = "http://www.aweber.com/thankyou.htm?m=default"; ?> |
| | |
| |
| The Following User Says Thank You to Brandon Tanner For This Useful Post: |
| | #6 |
| Warrior Member Join Date: 2012 Location: Scotland
Posts: 25
Thanks: 24
Thanked 1 Time in 1 Post
|
Excellent! That worked a treat! Thank You very much Brandon. Iain |
|
Iain Howard http://answertobiz.co.uk | |
| |
| | #7 |
| Advanced Warrior War Room Member Join Date: 2006 Location: USA
Posts: 1,907
Thanks: 236
Thanked 1,377 Times in 676 Posts
|
Yeah, no prob! |
| | |
| |
| | #8 |
| Warrior Member Registered Member Join Date: 2013
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
|
Is it possible to do this in wordpress? I've got a membership site and I want all members to be able to plug in their own aweber list name. I've created a custom field for the each member to put in their list name and then created a function that pulls back the correct list name. I can call the function in a normal page using [GetUserRefID] and it displays the list name but when I put it in like the example below the list name ends up been blank <input type="hidden" name="listname" value="[GetUserRefID]"> Any help appreciated |
| |
|
| Bookmarks |
| Tags |
| aweber, change, code, dynamically, optin, touching, values |
| |