LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
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
Thor_2.0
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,217
Blog Entries: 23

Rep: Reputation: 279Reputation: 279Reputation: 279
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
Thor_2.0
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,217
Blog Entries: 23

Original Poster
Rep: Reputation: 279Reputation: 279Reputation: 279
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Thor_2.0 Red Hat 3 05-18-2010 02:05 PM
screen driver - some hlp pls...tnx Thor_2.0 Linux - Desktop 1 06-27-2009 08:28 AM
XS denied - why? pls hlp! Thor_2.0 Programming 2 06-02-2009 09:42 AM
Java and PHP - pls hlp Thor_2.0 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


All times are GMT -5. The time now is 04:09 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration