dynamically change aweber optin values without touching code

7 replies
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
#aweber #change #code #dynamically #optin #touching #values
  • Profile picture of the author Brandon Tanner
    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.
    Signature

    {{ DiscussionBoard.errors[9000231].message }}
    • Profile picture of the author Iainhbb
      Thanks Brandon!

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

      Iain
      {{ DiscussionBoard.errors[9001111].message }}
      • Profile picture of the author Iainhbb
        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
        {{ DiscussionBoard.errors[9003403].message }}
        • Profile picture of the author Brandon Tanner
          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";
          ?>
          Signature

          {{ DiscussionBoard.errors[9003523].message }}
          • Profile picture of the author Iainhbb
            Excellent!

            That worked a treat! Thank You very much Brandon.

            Iain
            {{ DiscussionBoard.errors[9003957].message }}
            • Profile picture of the author Brandon Tanner
              Yeah, no prob!
              Signature

              {{ DiscussionBoard.errors[9004129].message }}
              • Profile picture of the author PaulMcOnline
                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
                {{ DiscussionBoard.errors[9435741].message }}

Trending Topics