Can someone tell me if Im way off or even close...
I currently have a script to show a webpage Ive got hosted on another server, also I got the script to start and stop displaying HTML at two points.
My question would be can I still go through the $contents and remove HTML from set start and stop points.
$start="<!-- starts";
$end="ends here.";
$url1 = "$myurl";
$fh = fopen($url1,"r");
$contents = "";
do {
$data = fread($fh, 8192);
if (strlen($data) == 0) {
break;
}
$contents .= $data;
} while(true);
fclose($fh);
$start_position=strpos($contents, $start);
$end_position=strpos($contents, $end)+strlen($end);
$length=$end_position-$start_position;
$contents=substr($contents, $start_position, $length);
echo "$contents";
A form is not needed and can be stripped.
Where would this horrible script effort be made into the above very nice script?
$startform="<form";
$endform="</form>";
$contents=strpos($contents, $startform);
$end_position=strpos($contents, $endform)+strlen($endform);
$length=$end_position-$start_position;
$contents=substr($contents, $start_position, $length);