/    Sign up×
Community /Pin to ProfileBookmark

getting parsed page source

Posting this in PHP & Javascript forums:

Is there a way to get the contents of a page without loading the page in a browser window, when the page is php?

I know normally this would be fine, but because the page is php, it would need parsing. I need the output once it has been parsed.

If I have to, I can create a window and parse the file, then tear it asunder until I have the content that I need.

Thx!

CM!

to post a comment
JavaScript

7 Comments(s)

Copy linkTweet thisAlerts:
@CrazyMerlinauthorMay 03.2006 — Thanks Ultimater...I knew I'd have to get into ajax at some point...may as well be now.
Copy linkTweet thisAlerts:
@CrazyMerlinauthorMay 03.2006 — http requester doesn't work...

...I forgot to mention that the source is https
Copy linkTweet thisAlerts:
@sridhar_423May 03.2006 — donno whether this logic will be useful to you or not... give it a try.

[upl-file uuid=1f334046-8e21-4ee8-839b-452bc32bf12a size=894B]test_2.zip[/upl-file]
Copy linkTweet thisAlerts:
@UltimaterMay 03.2006 — http requester doesn't work...

...I forgot to mention that the source is https[/QUOTE]

Yes it does, mine in the link works. Doesn't matter if it's HTTP, HTTPS, or even FTP, as long as you can get PHP to request it, there is no issues. In my example, PHP is doing all the work and packing the results into a string for JavaScript via appending a SCRIPT tag to the document and calling a function to tell JavaScript to do something with the new string. JavaScript allows you to link to an external SCRIPT cross-domain with no issues.

Perhaps a more detailed response would help us define “doesn't work”.

Any errors in the JavaScript console? When is the error fired? What is the code you are using? etc etc.
Copy linkTweet thisAlerts:
@CrazyMerlinauthorMay 04.2006 — When I say it isn't working, I get this error from the page at the link you provided:

Error: SSL Fatal Protocol Error
Copy linkTweet thisAlerts:
@UltimaterMay 04.2006 — <i>
</i>&lt;?php
// Turn off all error reporting
error_reporting(0);

$p="https://prodca.click4talk.com/c4a/admin/daal.php?gid=30119&amp;un=spirit";
echo file_get_contents($p);
?&gt;
×

Success!

Help @CrazyMerlin spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.2,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...