Simple HTML Question

Discussion in 'HTML & Website Design' started by m82492, Feb 9, 2011.

  1. #1
    I have an html page that has 12 paypal buttons on it. Each button code has the paypal email address. Is there a way I can have that email address pull from one central text file or even one place from within that html page rather than having to change the email address 12 different times? I know it can be done in PHP but looking to do it for an html page.
     
    m82492, Feb 9, 2011 IP
  2. moads

    moads Member

    Messages:
    115
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    28
    #2
    You could just code it in PHP and then change your PHP configuration file to process .html files too.
     
    moads, Feb 9, 2011 IP
  3. jawanda

    jawanda Peon

    Messages:
    151
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Here's a way to do it with javascript, assuming you are using the standard form-based paypal button:

    <script>
    var newEmail = ;
    document.formName1.business.value=newEmail;
    document.formName2.business.value=newEmail;
    document.formName3.business.value=newEmail;
    document.formName4.business.value=newEmail;
    document.formName5.business.value=newEmail;
    document.formName6.business.value=newEmail;
    document.formName7.business.value=newEmail;
    document.formName8.business.value=newEmail;
    document.formName9.business.value=newEmail;
    document.formName10.business.value=newEmail;
    document.formName11.business.value=newEmail;
    document.formName12.business.value=newEmail;
    </script>

    Change formName1 - formName12 to the names of your actual Paypal buttons. When you want to change the email address, change the var on the first line and all the buttons will be updated. Of course, if someone has javascript disabled it will default to whatever value is already in the static code, hence why it would be better to use php in the long run ... but this will work too.
     
    jawanda, Feb 10, 2011 IP
  4. ross88online

    ross88online Peon

    Messages:
    15
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    You may use javascript or php .But php one is best.
     
    ross88online, Feb 24, 2011 IP