I have a nudging feeling that a
Parsing results from a different php page
Moderator: General Moderators
- andym01480
- Forum Contributor
- Posts: 390
- Joined: Wed Apr 19, 2006 5:01 pm
Parsing results from a different php page
I have a script that is generating a pdf file using fpdf. It needs to grab the html output from a different script called listing.php, strip out the html and reformat it to insert into the pdf. Bizarrely I think i can work out the processing easily enough, but the grey matter has gone blank on grabbing it from the output of listing.php in the first place!
I have a nudging feeling that a
will be in order after the first reply!
I have a nudging feeling that a
-
SpiderMonkey
- Forum Commoner
- Posts: 85
- Joined: Fri May 05, 2006 4:48 am
I recall a long time ago I did HTML requests from php.
I'll look up what I did and post it if noone else knows this.
edit: Hmmm, apparantly last time I did in ASP not php
Regardless, I think this is what you are looking for:
http://uk2.php.net/manual/en/function.fsockopen.php
Connect to the server hosting the php page and you can treat its output like a file.
I'll look up what I did and post it if noone else knows this.
edit: Hmmm, apparantly last time I did in ASP not php
Regardless, I think this is what you are looking for:
http://uk2.php.net/manual/en/function.fsockopen.php
Connect to the server hosting the php page and you can treat its output like a file.
- andym01480
- Forum Contributor
- Posts: 390
- Joined: Wed Apr 19, 2006 5:01 pm
On the support forum for the calendar software I was using, it has been suggested to use ob_start and ob_get_contents
Will give it a try and come back!
Code: Select all
<?php
ob_start();
include ("listing.php");
$output = ob_get_contents();
ob_end_clean();
//process $output blah blah
?>- andym01480
- Forum Contributor
- Posts: 390
- Joined: Wed Apr 19, 2006 5:01 pm
[SOLVED] Parsing results from a different php page
Hallelujah! It works, now to work out how to process it!