473,387 Members | 1,435 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

how to 'implode' a URL ??

Rob
hi,

using PHP 4.3.3 and Apache (ADVX) 2.0.47 and i want to get the contents of
my SETI stats site :

$personal = implode("",
@file("http://setiathome.ssl.berkeley.edu/fcgi-bin/fcgi?email=$email&cmd=user_stats_new"));

which gives me this :

Warning: implode(): Bad arguments. in
/home/rob/www/php/phpMySetiStats/download.php on line 4

what am i doing wrong ? i used this code a couple of months back on somewhat
older versions of PHP/Apache in Windows2000 and it worked ... ??
Jul 17 '05 #1
6 5600

"Rob" <un*****@anonymous.net> wrote in message
news:vt************@corp.supernews.com...
hi,

using PHP 4.3.3 and Apache (ADVX) 2.0.47 and i want to get the contents of
my SETI stats site :

$personal = implode("",
@file("http://setiathome.ssl.berkeley.edu/fcgi-bin/fcgi?email=$email&cmd=use
r_stats_new"));
which gives me this :

Warning: implode(): Bad arguments. in
/home/rob/www/php/phpMySetiStats/download.php on line 4

what am i doing wrong ? i used this code a couple of months back on somewhat older versions of PHP/Apache in Windows2000 and it worked ... ??


Or

you could just read it from

$SETI_DIRECTORY/user_info.sah
......
nresults=8505

Jul 17 '05 #2
On Wed, 17 Dec 2003 00:03:19 +0100, Rob <un*****@anonymous.net> wrote:
using PHP 4.3.3 and Apache (ADVX) 2.0.47 and i want to get the contents of
my SETI stats site :

$personal = implode("",
@file("http://setiathome.ssl.berkeley.edu/fcgi-bin/fcgi?email=$email&cmd=user_stats_new"));

which gives me this :

Warning: implode(): Bad arguments. in
/home/rob/www/php/phpMySetiStats/download.php on line 4

what am i doing wrong ? i used this code a couple of months back on somewhat
older versions of PHP/Apache in Windows2000 and it worked ... ??


You've suppressed warnings with @, and you're using the return value from
file() directly. So there's two easy places you can help yourself:

(a) Remove the @, and look at any warning produced.
(b) Execute the file() separately and use var_dump to examine what it returns.

Read the manual page, and what file() can return: http://uk2.php.net/file
Which of the two possible return types could give a problem with implode()?

And anyway - if you're on 4.3, you may as well use file_get_contents().

--
Andy Hassall (an**@andyh.co.uk) icq(5747695) (http://www.andyh.co.uk)
Space: disk usage analysis tool (http://www.andyhsoftware.co.uk/space)
Jul 17 '05 #3
Rob
Andy Hassall wrote:
You've suppressed warnings with @, and you're using the return value from
file() directly.
ah, ok ... now i get this (e-mail edited!) :

Warning: file(): php_network_getaddresses: getaddrinfo failed: Temporary
failure in name resolution in /home/rob/www/php/phpMySetiStats/download.php
on line 7

Warning: file(http://...@<my email>&cmd=user_stats_new): failed to open
stream: Resource temporarily unavailable in
/home/rob/www/php/phpMySetiStats/download.php on line 7

but using the URL directly from Mozilla gives me the stats page, so it is
there and available.
And anyway - if you're on 4.3, you may as well use file_get_contents().


ok.
btw ; in this case it gives the same error :

Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed:
Temporary failure in name resolution in
/home/rob/www/php/phpMySetiStats/download.php on line 8

so there's probably something wrong with the way i supply the URL ...
i'll keep trying ;-)


Jul 17 '05 #4
Rob wrote:

Andy Hassall wrote:
You've suppressed warnings with @, and you're using the return value from
file() directly.


ah, ok ... now i get this (e-mail edited!) :

Warning: file(): php_network_getaddresses: getaddrinfo failed: Temporary
failure in name resolution in /home/rob/www/php/phpMySetiStats/download.php
on line 7

Warning: file(http://...@<my email>&cmd=user_stats_new): failed to open
stream: Resource temporarily unavailable in
/home/rob/www/php/phpMySetiStats/download.php on line 7

but using the URL directly from Mozilla gives me the stats page, so it is
there and available.
And anyway - if you're on 4.3, you may as well use file_get_contents().


ok.
btw ; in this case it gives the same error :

Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed:
Temporary failure in name resolution in
/home/rob/www/php/phpMySetiStats/download.php on line 8

so there's probably something wrong with the way i supply the URL ...
i'll keep trying ;-)


You may want to urlencode() the $email address. If that doesn't work, maybe the
site uses a redirect or something? If so try fsockopen().

Regards,
Shawn
--
Shawn Wilson
sh***@glassgiant.com
http://www.glassgiant.com
Jul 17 '05 #5
Use a sniffer/packet capture, type the url into a browser, and watch
the header info, this could help you debug.

as was said, you may need to use a socket, then supply a cookie or
useragent or something.

There was a time when I had a page accessing an https document on
wellsfargos website, and then they restricted access to specific user
agents (netscape and ie only) so i used a socket and wrote the agent
header.
Mike Bradley
http://gzen.myhq.info -- free online php tools
Jul 17 '05 #6
Ok, me again

I wrote a small utility that you can use, if you using a windows 2000,
or xp (i have not tested on others)

This little program will let you watch the header exchage between your
browser and your server.

You just tell your browser to use a proxy/sock server at
127.0.0.1:8080 and your ready to go (be sure to remove the proxy/sock
setting from your browser when your done with the program or you will
be wondering why you cant surf)

You can find it here: http://gzen.myhq.info/sockview.php

Mike Bradley
http://gzen.myhq.info -- free online php tools
Jul 17 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Andreas Paasch | last post by:
I'm having trouble with the implode function and need some help here. I've been reading at php.net but that didn't solve my problem. I'm having the below code: $query = "SELECT top1, top2,...
3
by: Shawn Campbell | last post by:
Here's my scenario: I'm creating a build environment with one system acting as the main build dispatcher and other systems as the build hosts. On the main build system I have Apache, MySQL and...
11
by: Jeff | last post by:
Hello. Quick background as I dont wish to hog anyones time. I am a customer of a PHP/SQL programmer. A website that I had the programmer build for me is working great, with one exception. I...
5
by: Geoff Berrow | last post by:
I don't particularly need to do this but I've just found out that print implode("<br>", $_SERVER); Gives the warning : Notice: Array to string conversion in c:\phpdev\www... Doesn't do it...
2
by: DJ Craig | last post by:
I have 2-dimensional array with numeric indices for both dimensions, called $results, which contains the search results from a database. The first dimension contains the records, and the second...
4
by: Stephen Kay | last post by:
Maybe I don't understand how to use this yet, but I was using (example): $html = implode('', file('http://www.mysite.com/transbar.html')); echo $html; This works. But if I try it on a...
18
by: NoWhereMan | last post by:
Maybe a stupid question. ------------------------- 1 ------------------------- $str = ''; for($i=0; $i<10; $i++) $str .= $i;
1
by: scatfly | last post by:
I have a set of values that were put into a form and am now using this to put into a database. this is my error: "Warning: implode() : Bad arguments. in /home/xxxxxx/public_html/login.php on line...
6
by: tokcy | last post by:
Hi, I am having a problem with implode() function in PHP. whenever i am running my code it display an error like. Warning: implode() : Bad arguments. in D:\xampp\htdocs\admin\addspecs.php on...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.