473,767 Members | 2,077 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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=$ema il&cmd=user_sta ts_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 5619

"Rob" <un*****@anonym ous.net> wrote in message
news:vt******** ****@corp.super news.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=$ema il&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*****@anonym ous.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=$ema il&cmd=user_sta ts_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_conten ts().

--
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_get addresses: 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_conten ts().


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

Warning: file_get_conten ts(): php_network_get addresses: 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_get addresses: 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_conten ts().


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

Warning: file_get_conten ts(): php_network_get addresses: 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***@glassgian t.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
3209
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, top3, top4, top5, top6, top7, top8, top9, pricesmall, pricelarge FROM esperia WHERE productnumber = '$bestil'";
3
5489
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 PHP installed and I'm building a website that will allow people to view/start/etc. builds. I'm trying to get PHP to implode a log file that resides on one of the host builds systems. I have the host and and the share, so what I'm passing into...
11
2245
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 have limited programming experience, most of it Pascal/C++ and I haven't programmed for many years now even then it was mediocre programming of small this and thats.
5
3911
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 with any other array and of course foreach($_SERVER as $value){
2
1667
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 contains the fields. I want to convert it into an XHTML table to echo to the browser. For a 1-dimensional array, I would do this with implode(). Can I use implode() on a 2D array? If not, is there some other function I could use to do this, or...
4
1605
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 .php file:
18
5921
by: NoWhereMan | last post by:
Maybe a stupid question. ------------------------- 1 ------------------------- $str = ''; for($i=0; $i<10; $i++) $str .= $i;
1
2364
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 177 Couldn't execute insert query." $today = date("Y-m-d"); $fields_str = implode(",",$fields); $values_str = implode('","',$values); <=line 177 $fields_str .=",createdate";
6
2435
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 line 8 and my code is $as = $_POST;
0
9405
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10013
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9841
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6655
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5280
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5424
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3930
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3533
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2807
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.