user1325578
user1325578

Reputation: 51

How do You Print PHP Object to Separate HTML Page

so I have:

$url = unserialize(base64_decode($info['story_frame']));

print $url->html;

On my php page but want to be able to format the printed code and chose where in the html it goes. Any Ideas?

Upvotes: 0

Views: 327

Answers (3)

Sriniwas
Sriniwas

Reputation: 515

You can also require the above page in the other html page.. anyways for even requesting the POST object, u have to anyways convert it to a php page. So now u have two ways of achieving it..

  • One requesting the POST object.

i.e

first phppage

      <?php
      $url = unserialize(base64_decode($info['story_frame']));
      ?>

      <form action="urhtmlpage.php" method="post">
      <input type="hidden" name="url" value="<?php echo $url ?>">
      </form>

destination php page

      <?php echo $_POST['url'] ?>           
  • Requiring the other page in your new page. first phppage

       <?php  
       $url = unserialize(base64_decode($info['story_frame']));
       ?> 
    

destination php page

      <?php
      require("yourphppage.php");
      echo $url; 
      ?>

But for both ways convert your HTML page into PHP page

Upvotes: 2

Josh Miller
Josh Miller

Reputation: 120

Let's say you put this code in a page called "print.php".

On the code which you would want to put the output on, try the following:

<div class="formatMe">
    <?php include 'print.php'; ?>
</div>

You will be able to move the div around as you please, and the content will move with it.

Upvotes: 0

Philip Kirkbride
Philip Kirkbride

Reputation: 22879

You should probably make that other html page a php page and then request post.

Post to another page within a PHP script

Upvotes: 0

Related Questions