メソッドGETを使用してフォームデータを渡すので、代わりに、htmlをプルするためのURLを作成するページにフォームデータを渡すことができます...
index.phpは上記のような形式になり、urlCreator.phpに投稿されます。
form.phpは不要になったため、削除できます。魔法はurlCreator.phpファイルで発生します。
urlCreator.php(NEW)には、次のようなコードが含まれます。
<?php
// urlCreator.php will get variables passed to it from index.php
// Now create the url using the passed variables
$url = "http://briandempsey.org.uk/Newstool/form.php?title=" . $_GET['title'] . "&color=" . $_GET['color'] . "&Articlecontent=" . $_GET['Articlecontent'] //and so on to build the whole url
//Now get the pages html
$html = file_get_contents($url);
?>
変数にhtmlが含まれているので、str_replaceを使用してHTMLをクリーンアップするか、必要に応じて操作できます。
<?php
// Still in urlCreator.php
// With the html in a variable you could now edit out the divs and echo the results
$html = str_replace("<div style=\"background-color: #008299; height: auto; width: 100%; margin-left: 10px;\">", "", $html); //removes the intro div
$html = str_replace("</div>", "", $html); //removes the closing div
//Finally echo out the html to the page for copy+paste purposes
echo $html;
?>