Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Post-Kicker, -Byline & -Footer (http://forum.bytesforall.com/forumdisplay.php?f=17)
-   -   Footer php wierdness (http://forum.bytesforall.com/showthread.php?t=9405)

Kadin Sep 4, 2010 01:55 PM

Footer php wierdness
 
I was trying to execute some php code and it kept screwing up so I pasted some test code into the ATO -> Edit POST/PAGE -> Footer: homepage

Quote:

<?php
$text = '<p>Test paragraph.</p><!-- Comment --> <a href="#fragment">Other text</a>';
echo strip_tags($text);
echo "\n";

// Allow <p> and <a>
echo strip_tags($text, '<p><a>');
?>
This should spit something out like:

Quote:

Test paragraph. Other text
<p>Test paragraph.</p> <a href="#fragment">Other text</a>
But instead I get:

Quote:

Other text'; echo strip_tags($text); echo "\n"; // Allow
and echo strip_tags($text, '

'); ?>
Any clues?

P.S. Almost forgot to link the site. If you want to take a peek it is www.pvpgamer.com
I disabled all the plugins and it did not fix the problem.

juggledad Sep 4, 2010 02:24 PM

change it to
HTML Code:

<?php $text = '<p>Test paragraph.</p><!-- Comment --> <a href="#fragment">Other text</a>';
echo strip_tags($text);
echo "\n";

// Allow <p>
and <a>
echo strip_tags($text, '<p><a>');
?>

note you will not see
HTML Code:

<p>Test paragraph.</p> <a href="#fragment">Other text</a>
unless you look at the source because it is html and when you view the page, the html gets processed so you will see
HTML Code:

Test paragraph. Other text
Test paragraph.

Other text


Kadin Sep 4, 2010 04:13 PM

So the carriage return killed it. This is why I don't code for a living lol.


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.