Re: [PHP-DB] fopen

2004-12-23 Thread Jason Wong
On Thursday 23 December 2004 16:36, Yemi Obembe wrote:

> How can I get the file name of the home page of a url I opened with fopen()
>  this way:
>
> $handle = fopen("http://www.example.com/";, "r");
>
> ?

You can't. 

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-db
--
/*
I'm wet!  I'm wild!
*/

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] fopen

2004-12-23 Thread Yemi Obembe
Hi list,
How can I get the file name of the home page of a url I opened with fopen()  
this way:
 
$handle = fopen("http://www.example.com/";, "r");

?





-

A passion till tomorrow,
Opeyemi Obembe | ng.clawz.com





__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: [PHP-DB] fopen : Supplied argument is not a valid File-Handle resource

2003-09-30 Thread Jason Wong
On Tuesday 30 September 2003 18:35, Ferdian wrote:
> > How about putting in some error checking code as per example in manual?

> The error was on : $ns = fsockopen($com_server,43);
> fputs($ns,"$domname\r\n");

That is *where* the error occurred. But *what* is the error? 

Again, refer to examples in manual.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-db
--
/*
Somehow I reached excess without ever noticing when I was passing through
satisfaction.
-- Ashleigh Brilliant
*/

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] fopen : Supplied argument is not a valid File-Handle resource

2003-09-30 Thread Ferdian
> How about putting in some error checking code as per example in manual?
>


Hi Jason,

The error was on : $ns = fsockopen($com_server,43);
fputs($ns,"$domname\r\n");

Any solutions ?

Kind Regards,
Ferdian

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] fopen : Supplied argument is not a valid File-Handle resource

2003-09-29 Thread Jason Wong
On Monday 29 September 2003 15:30, Ferdian wrote:

Please post to the correct list, this has nothing to do with databases.

Please do not post multiple times. Wait patiently for a response!

>  I use this script

[snip]

> $ns = fsockopen($com_server,43); fputs($ns,"$domname\r\n");
> $result = '';
> while(!feof($ns)) $result .= fgets($ns,128); fclose($ns);
> if (eregi($com_nomatch,$result)) { dispav($domname); } else {
>  dispun($domname,$com_server); }
>}
>echo ' ';
>   }
>
>
>  my PHP Version 4.1.2
>
>  And I get Warning :
>
>  Warning: Supplied argument is not a valid File-Handle resource in
> /home/sites/site1/web/whoisnew.php on line 584

[snip]

How about putting in some error checking code as per example in manual?

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-db
--
/*
Documentation:
Instructions translated from Swedish by Japanese for English
speaking persons.
*/

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] fopen : Supplied argument is not a valid File-Handle resource

2003-09-29 Thread Ferdian
Dear All,
 
 I use this script
 
 if ( ($type == "all" or $type == "com") and $com_include )
  {
   $com_array = array($ddomain.".com",$ddomain.".net");
   $com_count = count($com_array);
   $i=0;
   for ($i=0;$i<$com_count;$i++)
   {
$domname = $com_array[$i];
$ns = fsockopen($com_server,43); fputs($ns,"$domname\r\n");
$result = '';
while(!feof($ns)) $result .= fgets($ns,128); fclose($ns);
if (eregi($com_nomatch,$result)) { dispav($domname); } else {
 dispun($domname,$com_server); }
   }
   echo ' ';
  }
 
 
 my PHP Version 4.1.2
 
 And I get Warning :
 
 Warning: Supplied argument is not a valid File-Handle resource in
/home/sites/site1/web/whoisnew.php on line 584
Warning: Supplied argument is not a valid File-Handle resource in
/home/sites/site1/web/whoisnew.php on line 586
 
 Anyone can help me ?
 

Thanks a lot

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] fopen() question and auto update question

2003-06-08 Thread Tony S . Wu
has any of you have any problem with fopen() that it can't open some 
web page?
i am trying to use it to gather information from other web pages, but i 
am having problem with one particular website, macmall.com.
might anyone know what the problem is?
also, if there is no solution to this, i am going to have to abandon 
the idea by using fopen() to gather information.
can anyone suggest an alternative way, which won't cost me too much 
time to get to it?
there will be around 200 data to be updated each time.
thanks a lot.

Tony S. Wu
[EMAIL PROTECTED]
"The world doesn't give us hope - it gives us chance."
http://homepage.mac.com/tonyswu/tonyswu- My web page.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] fopen() alternative

2002-10-24 Thread Michel Bakkenes - bakkenes.net
Hey,
 
I need to check the existence of a webaddress on a foreign webserver. I
could use fsocketopen to check the domain only, _but_ the important
thing is to check one or multiple directories like
http://webservername.com/subdir/dir. 
I found out that the common way is to use fopen() for similair
functionality, but the it's too slow when I want to check 50+ addresses.
 
Is there an alternative for the fopen() function?
 
With Regards,
 
Michel Bakkenes
Bakkenes.net



Re: [PHP-DB] fopen() question

2002-06-06 Thread Bogdan Stancescu

Also, if you check many URL's from the same script, make sure neither 
PHP nor the browser times out. For PHP, set_time_limit() and for the 
browser echo a space and flush() after each test.

Bogdan

Bogdan Stancescu wrote:

> Try $fp=@fopen( etc
>
> Bogdan
>
> Tony wrote:
>
>> I have a database and I am writing a script to auto-update some 
>> information
>> in the database.
>> That requires me to read data from database, find the URL, read the URL,
>> find the information I want, then update it in the database.
>> My problem is, for example I read one record from database who's URL is
>> http://www.somedomain.com/.
>> And I try to read the URL with fopen() for information:
>>
>> $fp = fopen(³http://www.comedomain.com/², ³r²);
>>
>> if (!$fp)
>> {
>>echo ³URL not available.²;
>>exit;
>> }
>>
>> If the URL is available, things will work fine.
>> But if the URL is NOT available, I will get a error saying ³attempt 
>> to load
>> file ³MyFile¹s URL² failed² from browser.
>> It¹s supposed to output the string ³URL not available², isn¹t it?
>> Anyone know how to get around with this?
>>
>>
>> Tony S. Wu
>> [EMAIL PROTECTED]
>>
>>
>>  
>>
>
>
>
>




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] fopen() question

2002-06-06 Thread Bogdan Stancescu

Try $fp=@fopen( etc

Bogdan

Tony wrote:

>I have a database and I am writing a script to auto-update some information
>in the database.
>That requires me to read data from database, find the URL, read the URL,
>find the information I want, then update it in the database.
>My problem is, for example I read one record from database who's URL is
>http://www.somedomain.com/.
>And I try to read the URL with fopen() for information:
>
>$fp = fopen(³http://www.comedomain.com/², ³r²);
>
>if (!$fp)
>{
>echo ³URL not available.²;
>exit;
>}
>
>If the URL is available, things will work fine.
>But if the URL is NOT available, I will get a error saying ³attempt to load
>file ³MyFile¹s URL² failed² from browser.
>It¹s supposed to output the string ³URL not available², isn¹t it?
>Anyone know how to get around with this?
>
>
>Tony S. Wu
>[EMAIL PROTECTED]
>
>
>  
>




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] fopen() question

2002-06-06 Thread Tony

I have a database and I am writing a script to auto-update some information
in the database.
That requires me to read data from database, find the URL, read the URL,
find the information I want, then update it in the database.
My problem is, for example I read one record from database who's URL is
http://www.somedomain.com/.
And I try to read the URL with fopen() for information:

$fp = fopen(³http://www.comedomain.com/², ³r²);

if (!$fp)
{
echo ³URL not available.²;
exit;
}

If the URL is available, things will work fine.
But if the URL is NOT available, I will get a error saying ³attempt to load
file ³MyFile¹s URL² failed² from browser.
It¹s supposed to output the string ³URL not available², isn¹t it?
Anyone know how to get around with this?


Tony S. Wu
[EMAIL PROTECTED]


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] fopen ; fstat

2001-11-19 Thread Mister16

Hi everybody!!
Does anybody know how to use fopen and fstat!
I used it on local files and refered files on the own server, but it doesn't
show (e.g. the filesize) of my server with the downloadfiles, which is not
the same server the php files are on!

I've also added the source code, so please help me if you can!!

Thanx!!

Mister16

http://www.ganymede.spaceports.com/~mister16/2inseln.exe";,
"r"); echo "Datei geladen!!";
$t=fstat($file); echo "Array über Funktion zugewiesen";
print $t["size"]; echo "Info ausgegeben!";
fclose ($file); echo "Datei geschlossen!";
/*if ($t >= 100) {
$t = $t / 100;
$t = round($t,3);
echo "$t MB";
}
elseif ($t >= 1000) {
$t = $t / 1000;
$t = round($t,3);
echo "$t KB";
}
else {
$t = round($t,3);
echo "$t Byte(s)";
};*/
?>






-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] fopen function

2001-08-10 Thread Michael Rudel

Hi Nathan,

... nope, there's no function for this, you have to do it for yourself.

Try something like:

file()
fopen() // "w" !
fputs() // your new entries
while (  )
{
   fputs() // write the array from file after your new entries
}
fclose()


... that's it, pretty easy =8)

Hope this helps.

Greetinx,
  Mike

Michael Rudel
- Web-Development, Systemadministration -

Besuchen Sie uns am 20. und 21. August 2001 auf der
online-marketing-düsseldorf in Halle 1 Stand E 16
___

Suchtreffer AG
Bleicherstraße 20
D-78467 Konstanz
Germany
fon: +49-(0)7531-89207-17
fax: +49-(0)7531-89207-13
e-mail: mailto:[EMAIL PROTECTED]
internet: http://www.suchtreffer.de
___



> -Original Message-
> From: Nathan Cavicchi [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, August 09, 2001 10:12 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] fopen function
>
>
>
> I made a simple submissions form that writes to a backup file
> using the
> fopen function.  I use the variable a+ or a, for the backup.
> it goes to the
> end of the file and adds the new info.  I need it to add the
> new data at the
> beginning of the file, but leave the file in tact.  Does
> anyone have any
> ideas on how to accomplish this.  I couldnt really find anything at
> php.net.
>
> Nathan
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
>


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] fopen function

2001-08-09 Thread Nathan Cavicchi


I made a simple submissions form that writes to a backup file using the
fopen function.  I use the variable a+ or a, for the backup.  it goes to the
end of the file and adds the new info.  I need it to add the new data at the
beginning of the file, but leave the file in tact.  Does anyone have any
ideas on how to accomplish this.  I couldnt really find anything at
php.net.

Nathan


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] FOPEN () communication

2001-07-16 Thread Ken Sommers

PHP manual says:
fopen
fopen -- Opens file or URL
Description
int fopen (string filename, string mode [, int use_include_path])

If filename begins with "http://"; (not case sensitive), an HTTP 1.0
connection is opened to the specified server, the page is requested using
the HTTP GET method, and a file pointer is returned to the beginning of the
body of the response.


consider this use of Fopen():

$movie_site = fopen("http://www.site.com/MovieResponder.php?star="; .
urlencode($star) . "&year=" . urlencode($year), "r");
$movie_info = fread($movie_site, 10240);
fclose($movie_site);
---
http://www.site.com/MovieResponder.php performs a query on it;s own database
with $star and $year


how does http://www.site.com/MovieResponder.php get the query result in the
body of the response?

a simple



echo ($result);


??

how does this stuff communicate?

where's a tutorial or some docs on it?

Ken



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]