Bobafart
03-01-2008, 04:23 AM
I am trying to post PHP code in a javascript header
here is an example of PHP code:
foreach ($feed->get_items() as $item){
?>
<div>
<p><a href="<?php echo $item->get_permalink(); ?>"><?php echo $item->get_title(); ?></a></p>
<?php echo $item->get_content(); ?>
<p>Source: <a href="<?php $feed = $item->get_feed(); echo $feed->get_permalink(); ?>"><?php $feed = $item->get_feed(); echo $feed->get_title(); ?></a></p>
</div>
<?php
}
now how would I get that code to displa in something like:
Header("content-type: application/x-javascript");
echo "document.write(\"output the above code into here \")"; // how do I do this?
here is an example of PHP code:
foreach ($feed->get_items() as $item){
?>
<div>
<p><a href="<?php echo $item->get_permalink(); ?>"><?php echo $item->get_title(); ?></a></p>
<?php echo $item->get_content(); ?>
<p>Source: <a href="<?php $feed = $item->get_feed(); echo $feed->get_permalink(); ?>"><?php $feed = $item->get_feed(); echo $feed->get_title(); ?></a></p>
</div>
<?php
}
now how would I get that code to displa in something like:
Header("content-type: application/x-javascript");
echo "document.write(\"output the above code into here \")"; // how do I do this?