1

I would like to make a generator to get easy work in eBay description. So i've created a page with some form input that send the value to a php page in the main page iframe. Now I need to take the full HTML code and put in the iframe (naturally I get the full rendered page) and I need to view the source code, copy and put in the eBay html description.

So, the question is: Can I convert the HTML code as plain text and put in a textbox so I can easily copy using a button? I don't need a wysiwycg.

I've googled it but can't find a reasonable result.

According to your reply, here is the code now:

Page1.php

// It's only the page containing the form that must to pass variables

Page2.php

$html = file_get_contents('desc.php');

echo '<textarea readonly style="border:none;resize:none" rows="50" cols="116" value="'. $html .'"></textarea>';

Page3.php

// This is the file desc.php that must to be in plaintext

Now I get the plain text file but the variables aren't passed since i've stored them in session.

And the textbox displays only half of the file, not showing the <link> and <style> tags.

Mr Lister
  • 45,515
  • 15
  • 108
  • 150
andreaem
  • 1,635
  • 2
  • 20
  • 49

1 Answers1

3

You can use file_get_contents

$homepage = file_get_contents('http://www.example.com/');


echo $homepage;

or

 echo "<td><input type='text' value='$homepage'/></td>";

or for i frame

<iframe> 
   <div inside frame>
      <$php echo $content; ?>
   </div>
</iframe>
ScaisEdge
  • 131,976
  • 10
  • 91
  • 107
  • Thanks a lot, seems to be work, but the question now is, how can I pass some variables to the $homepage file without using cookies or sessions? I must to send the values via GET to the page whit file_get_content and then display the final page code – andreaem Jan 22 '16 at 14:35
  • Maybe it's confusing, i need to replace some string, like images url and something else with the forms input values, so if i get the content of the page it will retrieve the $variable as plain text instead of replace values – andreaem Jan 22 '16 at 14:49
  • Sorry for the multiple comments, but i see that this don't write down the – andreaem Jan 22 '16 at 15:26
  • I see only now your comment ... there are a lot of questions.. just a suggestion if the question you have posted is solved . is better post the other question like separated question .. in this way .. all the SO communty can help you and not only me.. .. – ScaisEdge Jan 22 '16 at 15:27
  • thanks for the reply, i was updating the question but you're right, i will create another one thread. – andreaem Jan 22 '16 at 15:33
  • Ok .. is right .. and may be i can help you also in the other question good work.. – ScaisEdge Jan 22 '16 at 15:35