LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-27-2010, 05:42 AM   #1
ButterflyMelissa
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,766
Blog Entries: 23

Rep: Reputation: 411Reputation: 411Reputation: 411Reputation: 411Reputation: 411
Lightbulb How to poll for a page in PHP? pls hlp, tnx


Hi,

Ok, how do I poll for a page on a server using PHP?

If a user wanted a page that does not yet exist - but is being made at request - I'd like the script to "poke" the server to see if the page is ready to be displayed. If so, it would then transfer to that newly made page.

I read about "http_get", but do not seem to get it to work

Quote:
do
{
$flag = http_get("www.server.ext/page.htm");
}
while(!$flag);
Ok, there might be a simple way out, but I don't see it.

My info came from

http://be.php.net/manual/en/function.http-get.php

more specific:

Quote:
Returns the HTTP response(s) as string on success, or FALSE on failure.
Tnx for shedding some light, here

Thor
 
Old 05-27-2010, 08:32 AM   #2
brazilnut
Member
 
Registered: Nov 2007
Posts: 113

Rep: Reputation: 16
Just tried running it on my server and php stopped parsing the page when it reached that statement. I turned on error_reporting, but no errors...

So looking further up the php manual tree I found this statement:
Quote:
The following functions do not need the HTTP module to be present: header(), headers_list(), headers_sent(), setcookie() and setrawcookie().
http://be.php.net/manual/en/ref.http.php

So, looking further it appears you need to have pecl_http installed on your server to use http_get... see http://be.php.net/manual/en/http.install.php. (It wasn't avail on yum so i've not installed it to test, but i'd say that it'd be something to try...
 
1 members found this post helpful.
Old 05-27-2010, 08:58 AM   #3
brazilnut
Member
 
Registered: Nov 2007
Posts: 113

Rep: Reputation: 16
Generally your server will have cURL support... http://be.php.net/manual/en/curl.examples-basic.php
 
Old 05-28-2010, 04:15 AM   #4
ButterflyMelissa
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,766

Original Poster
Blog Entries: 23

Rep: Reputation: 411Reputation: 411Reputation: 411Reputation: 411Reputation: 411
Hi Brazilnut!

Thanks! Just the info I needed. On to the Batcave (the inner workings of the server involved) to install what I need!

Tnx again!!

Thor
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ACV denial after update - pls hlp, tnx ButterflyMelissa Red Hat 3 05-18-2010 02:05 PM
screen driver - some hlp pls...tnx ButterflyMelissa Linux - Desktop 1 06-27-2009 08:28 AM
XS denied - why? pls hlp! ButterflyMelissa Programming 2 06-02-2009 09:42 AM
Java and PHP - pls hlp ButterflyMelissa Linux - Software 5 04-11-2009 03:14 AM
cant run startx... pls help... tnx in advance kublador Linux - Newbie 1 08-16-2002 04:13 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:33 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration