Register Advertise with usHelp Desk Today's Posts Search

Closed Thread
Thread Tools Search this Thread
Unread 25th Sep 2009, 02:01 PM   #1
Grouchy Old Geezer
War Room Member
 
Kirk Ward's Avatar
 
Join Date: 2006
Location: Ellijay, GA, USA. (Talk about being in the woods!)
Posts: 673
Thanks: 279
Thanked 62 Times in 47 Posts
Default
Wordpress breaking onsite PayPal button code brackets
Share on: 
fb share twitter share gplus share more share

Wullo dear code gurus,

I have an unencrypted PayPal button on my site that contains the following...
Code:
value="<?PHP echo $_SERVER['REMOTE_ADDR']; ?>" />
Which Wordpress regularly breaks and turns into ...
Code:
value="&lt;?PHP echo $_SERVER['REMOTE_ADDR']; ?&gt;" />
Is there anything that I can do to stop Wordpress from doing this?

Many thanks in advance,
Kirk

"We are not here to sell a parcel of boilers and vats, but the potentiality of growing rich beyond the dreams of avarice."

Dr. Samuel Johnson (Presiding at the sale of Thrales brewery, London, 1781)
Kirk Ward is offline  
Unread 25th Sep 2009, 06:09 PM   #2
Warrior Member
 
tguillea's Avatar
 
Join Date: 2009
Posts: 20
Thanks: 0
Thanked 2 Times in 2 Posts
Default
Re: Wordpress breaking onsite PayPal button code brackets
Share on: 
fb share twitter share gplus share more share

I'm not much of a wordpress person but I would switch to a SSI and make a file called "paypal.php" with the code from your VALUE attribute in it.

Then where the VALUE attribute is, put the code
Code:
<!--#include file="paypal.php" -->

I think that should do the trick as WP would read it as a comment rather than potential malicious code (which I'm guessing is your problem)

"One of the best GPT sites ever!"
Offers: Over $1500 | Referral Commission: 15-25% | Payout Time: 3-5 Business Days
tguillea is offline  
The Following User Says Thank You to tguillea For This Useful Post:
Unread 25th Sep 2009, 07:02 PM   #3
Advanced Warrior
 
Abledragon's Avatar
 
Join Date: 2007
Location: Hong Kong.
Posts: 838
Thanks: 3
Thanked 211 Times in 184 Posts
Default
Re: Wordpress breaking onsite PayPal button code brackets
Share on: 
fb share twitter share gplus share more share

You may also want to try installing the Raw-HTML plugin and then wrapping your PayPal code within the Raw-HTML tags.

Here's a review of Raw-HTML:

http://www.wealthydragon.com/blog/20...ordpress-html/

Cheers,

Martin.

WealthyDragon - Earning My Living Online
Abledragon is offline  
The Following User Says Thank You to Abledragon For This Useful Post:
Unread 25th Sep 2009, 10:03 PM   #4
Grouchy Old Geezer
War Room Member
 
Kirk Ward's Avatar
 
Join Date: 2006
Location: Ellijay, GA, USA. (Talk about being in the woods!)
Posts: 673
Thanks: 279
Thanked 62 Times in 47 Posts
Default
Re: Wordpress breaking onsite PayPal button code brackets
Share on: 
fb share twitter share gplus share more share

Thanks to both of you ...

These both sound like workable solutions. I'm going to try the plugin first, and then the SSI include to see what happens.

Again, thanks.

"We are not here to sell a parcel of boilers and vats, but the potentiality of growing rich beyond the dreams of avarice."

Dr. Samuel Johnson (Presiding at the sale of Thrales brewery, London, 1781)
Kirk Ward is offline  
Unread 27th Sep 2009, 06:34 AM   #5
VIP Warrior
War Room Member
 
ereadergold's Avatar
 
Join Date: 2008
Location: Montreal Canada
Posts: 2,390
Thanks: 1,017
Thanked 836 Times in 572 Posts
Blog Entries: 1
Default
Re: Wordpress breaking onsite PayPal button code brackets
Share on: 
fb share twitter share gplus share more share

Hi Kirk

Another WordPress Plugin that I use in this situation is this one:

WordPress › Exec-PHP WordPress Plugins

It lets you put raw HTML or PHP code within a post or page.

Bill
ereadergold is offline  
The Following User Says Thank You to ereadergold For This Useful Post:
Unread 27th Sep 2009, 07:59 AM   #6
Web Developer, IT Support
War Room Member
 
n7 Studios's Avatar
 
Join Date: 2008
Location: Birmingham, UK
Posts: 543
Thanks: 10
Thanked 81 Times in 69 Posts
Default
Re: Wordpress breaking onsite PayPal button code brackets
Share on: 
fb share twitter share gplus share more share

Hi Kirk,

If that HTML / PHP code is in a page or a post within Wordpress that you're editing, you'll need to use the Source / HTML view to put that code in.

If you put that code in the WYSIWYG part of the editor, it'll parse the characters into HTML elements, hence the issue you're experiencing.

Tim.

n7 Studios is offline  
The Following User Says Thank You to n7 Studios For This Useful Post:
Unread 27th Sep 2009, 04:12 PM   #7
Grouchy Old Geezer
War Room Member
 
Kirk Ward's Avatar
 
Join Date: 2006
Location: Ellijay, GA, USA. (Talk about being in the woods!)
Posts: 673
Thanks: 279
Thanked 62 Times in 47 Posts
Default
Re: Wordpress breaking onsite PayPal button code brackets
Share on: 
fb share twitter share gplus share more share

Hi Bill & Tim,

I'm using the HTML editor pane and I'm running the Exec-PHP plugin.

Been out of town for a wedding so I haven't had a chance to test the other two suggestions yet.

Thanks. I'll announce if either works.

Kirk

"We are not here to sell a parcel of boilers and vats, but the potentiality of growing rich beyond the dreams of avarice."

Dr. Samuel Johnson (Presiding at the sale of Thrales brewery, London, 1781)
Kirk Ward is offline  
Unread 27th Sep 2009, 04:56 PM   #8
Grouchy Old Geezer
War Room Member
 
Kirk Ward's Avatar
 
Join Date: 2006
Location: Ellijay, GA, USA. (Talk about being in the woods!)
Posts: 673
Thanks: 279
Thanked 62 Times in 47 Posts
Default
Re: Wordpress breaking onsite PayPal button code brackets
Share on: 
fb share twitter share gplus share more share

Hi and thanks for the feedback ...

I got some testing done ... The Raw_HTML plugin works okay and seems to be easy for where my site is developed at this point. I may test the SSI method as that seems like it could have some potential.

I did discover that the Raw_HTML plugin halts the working of Wordpress "shortcodes" by treating them as HTML and not allowing them to be parsed by Wordpress. This was important as I wanted them to be parsed and allow a custom plugin to be used where I centrally manage prices posted on my site. (... I use a little plugin I had developed which I call wp-central-pricing. You can email or pm for a copy.)

So having the shortcode parsed by Wordpress to dynamically insert the current price for a product everywhere on the site is important as I use every page I can as a sales page and this way the pricing is always correct.

Anyhoo, I digress.

So, the fix was easy enough. I merely put an end_raw comment before the shortcode, and a start_raw comment after the shortcode and the shortcode was parsed correctly. The Paypal button was generated properly without breaking the brackets tot eh lt and gt html codes, and the price was inserted properly into the shortcode inside the button.

Cool beans!

Thanks a bunch.

Kirk

"We are not here to sell a parcel of boilers and vats, but the potentiality of growing rich beyond the dreams of avarice."

Dr. Samuel Johnson (Presiding at the sale of Thrales brewery, London, 1781)
Kirk Ward is offline  
Closed Thread


Bookmarks

Tags
breaking, onsite, paypal, wordpress


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -6. The time now is 04:53 PM.