Register Advertise with usHelp Desk Today's Posts Search

Closed Thread
Thread Tools Search this Thread
Unread 2nd Mar 2014, 11:08 AM   #1
Warrior Member
 
Iainhbb's Avatar
 
Join Date: 2012
Location: Scotland
Posts: 25
Thanks: 24
Thanked 1 Time in 1 Post
Post
dynamically change aweber optin values without touching code
Share on: 
fb share twitter share gplus share more share

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


Last edited on 2nd Mar 2014 at 11:09 AM. Reason: typo
Iainhbb is offline  
Unread 3rd Mar 2014, 09:31 AM   #2
Advanced Warrior
War Room Member
 
Brandon Tanner's Avatar
 
Join Date: 2006
Location: USA
Posts: 1,907
Thanks: 236
Thanked 1,377 Times in 676 Posts
Default
Re: dynamically change aweber optin values without touching code
Share on: 
fb share twitter share gplus share more share

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.


Brandon Tanner is offline  
The Following User Says Thank You to Brandon Tanner For This Useful Post:
Unread 3rd Mar 2014, 03:15 PM   #3
Warrior Member
 
Iainhbb's Avatar
 
Join Date: 2012
Location: Scotland
Posts: 25
Thanks: 24
Thanked 1 Time in 1 Post
Default
Re: dynamically change aweber optin values without touching code
Share on: 
fb share twitter share gplus share more share

Thanks Brandon!

I will give that a try and let you know how I get on.

Iain

Iainhbb is offline  
Unread 4th Mar 2014, 10:17 AM   #4
Warrior Member
 
Iainhbb's Avatar
 
Join Date: 2012
Location: Scotland
Posts: 25
Thanks: 24
Thanked 1 Time in 1 Post
Default
Re: dynamically change aweber optin values without touching code
Share on: 
fb share twitter share gplus share more share

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

Iainhbb is offline  
Unread 4th Mar 2014, 10:55 AM   #5
Advanced Warrior
War Room Member
 
Brandon Tanner's Avatar
 
Join Date: 2006
Location: USA
Posts: 1,907
Thanks: 236
Thanked 1,377 Times in 676 Posts
Default
Re: dynamically change aweber optin values without touching code
Share on: 
fb share twitter share gplus share more share

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";
?>


Brandon Tanner is offline  
The Following User Says Thank You to Brandon Tanner For This Useful Post:
Unread 4th Mar 2014, 02:24 PM   #6
Warrior Member
 
Iainhbb's Avatar
 
Join Date: 2012
Location: Scotland
Posts: 25
Thanks: 24
Thanked 1 Time in 1 Post
Default
Re: dynamically change aweber optin values without touching code
Share on: 
fb share twitter share gplus share more share

Excellent!

That worked a treat! Thank You very much Brandon.

Iain

Iainhbb is offline  
Unread 4th Mar 2014, 03:35 PM   #7
Advanced Warrior
War Room Member
 
Brandon Tanner's Avatar
 
Join Date: 2006
Location: USA
Posts: 1,907
Thanks: 236
Thanked 1,377 Times in 676 Posts
Default
Re: dynamically change aweber optin values without touching code
Share on: 
fb share twitter share gplus share more share

Yeah, no prob!


Brandon Tanner is offline  
Unread 12th Aug 2014, 06:56 AM   #8
Warrior Member
Registered Member
 
Join Date: 2013
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default
Re: dynamically change aweber optin values without touching code
Share on: 
fb share twitter share gplus share more share

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
PaulMcOnline is offline  
Closed Thread


Bookmarks

Tags
aweber, change, code, dynamically, optin, touching, values


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -6. The time now is 02:07 AM.