Hey guys.. At this moment I have the following PHP code: $content = " <div class=\"postlinks\"> <ul> <li> <span id=\"trailr\"><a href=\"#trailer$r\" rel=\"facebox\"><img alt=\"trailer\" src=\"http://imgur.com/pQwmw.png\" width=\"50\" height=\"50\"/></a></span></li> <div id=\"trailer$r\" style=\"display:none;\"> Code (markup): When I do e.g. echo $content, it strips ALL of the id, rel etc.. it only leaves blank <span> and <div> tags.. Can anyone help me out how to display everything without getting stripped?
ah.. I'm pretty new at PHP heh, what do you recommend me doing instead? Because I need the $content variable to hold some html data..
$content = " <div class=\"postlinks\"> <ul> <li> <span id=\"trailr\"><a href=\"#trailer$r\" rel=\"facebox\"><img alt=\"trailer\" src=\"http://imgur.com/pQwmw.png\" width=\"50\" height=\"50\"/></a></span></li> <div id=\"trailer$r\" style=\"display:none;\"> PHP: Only thing wrong with this is lack of a closing "; . option 1: Use ' as the delimiter to avoid escaping ". $content = ' <div class="postlinks"> <ul> <li> <span id="trailr"><a href="#trailer' . $r . '" rel="facebox"><img alt="trailer" src="http://imgur.com/pQwmw.png" width="50" height="50"/></a></span></li> <div id="trailer'. $r .'" style="display:none;">'; PHP: option 2: drop the variable and use HTML. ( can use the shorthand tag <?=$r ?> ) <div class="postlinks"> <ul> <li> <span id="trailr"><a href="#trailer<?php echo $r ;?>" rel="facebox"><img alt="trailer" src="http://imgur.com/pQwmw.png" width="50" height="50"/></a></span></li> <div id="trailer<?php echo $r ;?>" style="display:none;"> PHP:
Thanks allot for trying to help me out so far guys.. Sorry for sounding like a noob but could you please elaborate? I need the html to be stored in a variable because I'm trying to make a script to remotely publish wordpress posts. And the template I am trying to use for the layout of the posts, needs to be stored in a variable. When I submit the variable, the html is still getting stripped down.. the <script> and the rel and span id's are being taken away.. ugh
go with option 1 or your original code if it has to be a variable. option 2 works better for direct output.
Yeah man, the post and everything works. But when the post is published, it is stripped of its <script> tags and the rel etc Do any of you have MSN so we can communicate easier?
option 2 is for sending to browser, which you dont want. the server probably doesnt allow javascript etc, so is stripping tags it doesnt like. Download wordpress and look at the source to see what it strips by default.
It does allow javascript. Also, it only displays the first <div id="postlinks"> but after that it strips and id or class tags that I have.. I'm gonna see if i can find what wordpress is stripping and how to bypass it.
Nope, because what I'm trying to do is make a form to just fill in certain fields instead of pasting the entire template i made, then looking into the code to paste specific links etc. that wastes allot of time. The form already works for remote posting, it's just that i can't seem to get around this stripping of tags
$content = " <div class=\"postlinks\"> <ul> <li> <span id=\"trailr\"><a href=\"#trailer$r\" rel=\"facebox\"><img alt=\"trailer\" src=\"http://imgur.com/pQwmw.png\" width=\"50\" height=\"50\"/></a></span></li> <div id=\"trailer$r\" style=\"display:none;\">[COLOR="Red"][B]";[/B][/COLOR] Code (markup): See the part in red. You forgot to close your string declaration.