Recent Topics

1 Mar 21, 2009 23:46    

My b2evolution Version: 2.x

I have a paypal button in the sidebar of a blog but the code won't function correctly if inserted directly into a post.

Is there something that I can do to facilitate that?

3 Mar 22, 2009 02:02

This is the basic code with the encryption taken out.

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="image" src="https://www.paypal.com/de_DE/i/btn/x-click-but04.gif" border="0" name="submit" alt="Zahlen Sie mit PayPal - schnell, kostenlos und sicher!">
<img alt="" border="0" src="https://www.paypal.com/de_DE/i/scr/pixel.gif" width="1" height="1">
<input type="hidden" name="encrypted" value="blahblah">
</form>

I had hoped that getting it to work directly in a post was as simple as surrounding it with a tag that lets it execute!

4 Mar 22, 2009 02:34

A form should work in a post. I have a working example of that. Perhaps a little more basic than this one.
Is there any clue to the problem? Is B2evo complaining about XHTML errors? Is the external 'action' the source of the issue?

5 Mar 22, 2009 02:53

Paypal error says:
"We were unable to decrypt the certificate id."

And yet this is the exact cut and paste from the widget that is working in the sidebar.

6 Mar 22, 2009 11:34

As an aside, your form is invalid xhtml ;)

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<div>
<input type="hidden" name="cmd" value="_s-xclick" />
<input type="image" src="https://www.paypal.com/de_DE/i/btn/x-click-but04.gif" style="border:none;" name="submit" alt="Zahlen Sie mit PayPal - schnell, kostenlos und sicher!" />
<img alt="" src="https://www.paypal.com/de_DE/i/scr/pixel.gif" style="border:none;width:1px;height:1px" />
<input type="hidden" name="encrypted" value="blahblah" />
</div>
</form>

¥

7 Mar 22, 2009 21:32

It was straight from Paypal. :'(

8 Mar 22, 2009 22:08

You might have to disable xhtml validation checking to get it to work. Can you view source to see if b2evo is correcting the technically incorrect code paypal gave you? The thing is if b2evo is 'fixing' the bits then that might be what is causing paypal to get all scared and run away.

9 Mar 23, 2009 00:05

Im interested in this topic having experimented with adding a similiar Paymate link to posts. What are the repercussions of disabling validation rules? I never wanted to risk it.

I tried your code above in a post (just previewed) and got warnings:

Illegal tag: form
Illegal tag: input

Afwas, you say a form should work in a post?

10 Mar 23, 2009 02:54

The source looks like this:

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input name="cmd" value="_s-xclick" type="hidden">
<input src="https://www.paypal.com/de_DE/i/btn/x-click-but04.gif" name="submit" alt="Zahlen Sie mit PayPal - schnell, kostenlos und sicher!" type="image" border="0"><br>
<img alt="" src="https://www.paypal.com/de_DE/i/scr/pixel.gif" width="1" border="0" height="1"><br>
<input name="encrypted" value="blahblah&lt;br /&gt;" type="hidden">
</form>

So to me it looks as if the &lt;br /&gt is being inserted inside the value that paypal is reading.

Therefore I went back to where I pasted the code into the post, and voilà there is a uncoded line break ie its not a <br /> but instead just a truncated line.

I fixed that and now the code works and paypal can interpret where the donation is for.

I still have an issue though with code further on being 'cut-off' and showing in the post - so perhaps that is the 'input' issue, as it occurs before the form close?

11 Apr 23, 2009 20:27

7doves wrote:

I still have an issue though with code further on being 'cut-off' and showing in the post - so perhaps that is the 'input' issue, as it occurs before the form close?

Ooops, sorry, just noticed this .... what happens if you use a valid xhtml form ( as I posted above ) ?

¥

12 Apr 23, 2009 22:55

Sorry Yabba, neither did I realise that you had changed the code in the above post - I thought that you had only re-quoted that which I had pasted.

I used your xhtml code just now and some of the text following the code is still missing - cut-off- gone!

13 Apr 24, 2009 08:11

Got a link to an example post?

¥

15 Apr 25, 2009 20:17

I haven't had a chance to look yet but another post reminded me of what the reason is, try this : /inc/_core/_param.funcs.php ( approx 1838 ) - change it to look like this

			// Push if not img or br or hr
			if($tag != 'br' && $tag != 'img' && $tag != 'hr' && $tag != 'param' && $tag != 'input' )
			{
				$stacksize = array_push ($tagstack, $tag);
				$closing = '>';
			}

¥

16 Apr 25, 2009 22:07

Yes that did it. Thank you.

Both the original and your xhtml compliant code work now without eating up any text that follows where the code is inserted.

Why didn't the xhtml compliant code work though (as it has a '/' at the end of the 'input' tag)? It's no biggie - just trying to understand ;)

17 Apr 26, 2009 08:29

The problem was that evo tries to tidy up your tags by auto-closing any that you've left open so it needed to be told that <input /> is a self-closing tag and doesn't need any evo help ;)

¥

18 May 15, 2009 16:08

Fixed in CVS, thanks to Mr. ¥åßßå :)


Form is loading...