adding java script tracker to pay to blog paypal subscription form

Hi, I am trying to add a tracking code in the pay to blog plug in, the subscription paypal form section and it seems to work alright in firefox but I am having issues in IE.
In IE after implementing the code I visit the blog account section in the blog admin and the admin header menu as well as the footer and the bottom two paypal monthly option pay buttons are missing.

here is the paypal subscription form on pay-to-blog.php as I am trying to make it work

<form action="' . $action . '" method="post">
<input type="hidden" name="cmd" value="_xclick-subscriptions">
<input type="hidden" name="business" value="' . get_site_option( "pay_to_blog_paypal_email" ) . '">
<input type="hidden" name="item_name" value="' . $current_site->site_name . ' Blog Activation">
<input type="hidden" name="item_number" value="' . $period . '">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="return" value="https://mydomain.com/affiliates/signup.php">
<input type="hidden" name="cancel_return" value="' . $blog_url . 'wp-admin/blog.php?updated=true&updatedmsg=' . urlencode(__('Transaction Canceled!')) . '">
<input type="hidden" name="notify_url" value="' . $blog_url . 'pay-to-blog-paypal.php">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="currency_code" value="' . get_site_option( "pay_to_blog_currency" ) . '">
<input type="hidden" name="lc" value="' . get_site_option( "pay_to_blog_paypal_site" ) . '">
<input type="hidden" name="custom" value="' . $period . '_' . get_site_option( "pay_to_blog_currency" ) . '_' . $wpdb->blogid . '">
<input type="hidden" name="a3" value="' . $amount . '">
<input type="hidden" name="p3" value="' . $period . '">
<input type="hidden" name="t3" value="M">
<input type="hidden" name="src" value="1">
<input type="hidden" name="sra" value="1">
<input type="hidden" name="custom" value="" id="pap_dx8vc2s5">
<script id="pap_x2s6df8d" src="http://mydomain.com/scripts/notifysale.php" type="text/javascript">
</script>
<p class="submit" style="border:none;padding-top:2px;">
<input type="submit" name="Submit" value="PayPal">
</p>
</form>

the only edits I did in the form are replacing the actual domain with "mydomain" for this example...
The additional code I am putting in for tracking is near the bottom which is;

<input type="hidden" name="custom" value="" id="pap_dx8vc2s5">
<script id="pap_x2s6df8d" src="http://mydomain.com/scripts/notifysale.php" type="text/javascript">
</script>

when this is included, IE screws up as described above. and if left out, every thing works fine. with tracking code in, it works fine in Firefox.

can anyone please help me with a fix so I can use this tracking code in the form?

thanks.

Tony V

  • TonyV

    can anyone help me out with this? I am still having a problem with it.
    using pay to blog plugin.
    do I have to do anything special to add javascript to the paypal form?
    I am trying to add this for example and I am getting a parse error.

    <script id="pap_x2s6df8d" src="http://mydomain.com/scripts/salejs.php" type="text/javascript">
    </script>
    <script type="text/javascript">
    PostAffTracker.setAppendValuesToField('||');
    PostAffTracker.writeCookieToCustomField('pap_dx8vc2s5');
    </script>

    this is the parse error.
    Parse error: syntax error, unexpected T_STRING in /home/ismyblog/public_html/wp-content/mu-plugins/pay-to-blog.php on line 166

    line 166 is PostAffTracker.writeCookieToCustomField('pap_dx8vc2s5');

    the custom field referred to in line 166 looks like this;
    <input type="hidden" name="custom" value="' . $period . '_' . get_site_option( "pay_to_blog_currency" ) . '_' . $wpdb->blogid . '" id="pap_dx8vc2s5">

    any help would be highly appriciated.
    thanks for your time.
    Tony V

  • TonyV

    Thanks Andrew,
    I am aware of the single quotes, and escaping quotes. however, this is not an echo, and you have html with " in this same form with no issues. So you got me.

    lines 166 starts like this as I mentioned
    PostAffTracker.writeCookieToCustomField('pap_dx8vc2s5');

    this is the line that is bringing up the parse error
    Parse error: syntax error, unexpected T_STRING in /home/ismyblog/public_html/wp-content/mu-plugins/pay-to-blog.php on line 166

    this is how the form code looks with the additions I put in

    <form action="' . $action . '" method="post">
    			<input type="hidden" name="cmd" value="_xclick-subscriptions">
    			<input type="hidden" name="business" value="' . get_site_option( "pay_to_blog_paypal_email" ) . '">
    			<input type="hidden" name="item_name" value="' . $current_site->site_name . ' Blog Activation">
    			<input type="hidden" name="item_number" value="' . $period . '">
    			<input type="hidden" name="no_shipping" value="1">
    			<input type="hidden" name="return" value="https://inthepowerof5.com/affiliates/signup.php">
    			<input type="hidden" name="cancel_return" value="' . $blog_url . 'wp-admin/blog.php?updated=true&updatedmsg=' . urlencode(__('Transaction Canceled!')) . '">
    			<input type="hidden" name="notify_url" value="' . $blog_url . 'pay-to-blog-paypal.php">
    			<input type="hidden" name="no_note" value="1">
    			<input type="hidden" name="currency_code" value="' . get_site_option( "pay_to_blog_currency" ) . '">
    			<input type="hidden" name="lc" value="' . get_site_option( "pay_to_blog_paypal_site" ) . '">
    			<input type="hidden" name="custom" value="' . $period . '_' . get_site_option( "pay_to_blog_currency" ) . '_' . $wpdb->blogid . '" id='pap_dx8vc2s5'>
    			<input type="hidden" name="a3" value="' . $amount . '">
    			<input type="hidden" name="p3" value="' . $period . '">
    			<input type="hidden" name="t3" value="M">
    			<input type="hidden" name="src" value="1">
    			<input type="hidden" name="sra" value="1">
    			<script id="pap_x2s6df8d" src="http://inthepowerof5.com/scripts/salejs.php" type="text/javascript">
                </script>
                <script type="text/javascript">
                PostAffTracker.setAppendValuesToField('||');
                PostAffTracker.writeCookieToCustomField('pap_dx8vc2s5');
                </script>
    			<p class="submit" style="border:none;padding-top:2px;">
    			<input type="submit" name="Submit" value="PayPal">
    			</p>
    		</form>

    can you please advise me where you would put the escapes?
    Thanks again for your time.
    Tony V

  • TonyV

    Thank you Andrew,
    I think I am getting it now.
    The only other thing is,,, after making adjustments to pay-to-blog.php and uploading it, I then login to an account that already made a paypal payment and it looks like they didn't... they are on the blog.php page and no menu items are showing. Can you explain to me the trigger so I can re coop the credits for this account. They have paid for subscription, and one is one month but there are 5 others who have paid by the year, so, I don't want to have to manually give credit for these accounts each time. Is there a way I can recoop these credits and put them back on the automated set up?
    thanks again for your time.
    Tony V

  • TonyV

    Thanks Andrew,
    it's not really live yet, but I had to have a few testers because I am doing more then just offering pay to blog. That's why I am having to set up a tracker. The only way that I knew how to test whether the tracking was working is to have a few people sign up for the service. I have a large list of people waiting on me to get this right. Down to the wire, having a hard time thinking straight half the time. Hoping I got it this time.
    Thanks for all your help.
    Tony V

  • Andrew

    Hi Tony,

    The only way that I knew how to test whether the tracking was working is to have a few people sign up for the service.

    On the site admin Pay to Blog page there's an option to use the live PayPal site or the sandbox site.

    By the way, I am in need of someone who knows what you know, are you available for hire?

    I'm afraid I'm not available for hire outside of Incsub. I stopped taking on side projects about a year ago.

    Thanks,
    Andrew

  • TonyV

    Hi Andrew,
    is it possible to have two notify url's in the pay-to-blog.php paypal subscription form?
    currently you have;
    <input type="hidden" name="notify_url" value="' . $blog_url . 'pay-to-blog-paypal.php">
    which talks to the ipn processor file. I would like to add another notify_url to send information to the tracking script I am using.. is this possible? if so, how would you add it in? like this maybe;

    <input type="hidden" name="notify_url" value="' . $blog_url . 'pay-to-blog-paypal.php, http://mydomainfortracking.php">

    thanks for any help.

    Tony V

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.