dynamically change aweber optin values without touching code

by 7 replies
9
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
#programming #aweber #change #code #dynamically #optin #touching #values
  • 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.
    • [ 1 ] Thanks
    • [1] reply
    • Thanks Brandon!

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

      Iain
      • [1] reply

Next Topics on Trending Feed