Re: [PHP] Checking for internet connection.

2009-12-22 Thread Daniel Brown
On Sat, Dec 19, 2009 at 19:13, Angus Mann wrote: > Hi all. > > I'w writing a PHP app that is designed to run over a LAN, so internet > connection for the server is not really essential. Some users may > deliberately not connect it to the internet as a security precaution. > > But I'd like the app

Re: [PHP] Checking for internet connection.

2009-12-22 Thread Andy Shellam
> > Both at home and at work there are caching DNS on the LAN. So a DNS > request may come back with a valid IP address when the WAN connection is > down. I still won't be able to connect to the remote site. Dig an external server - e.g. dig @a.root-servers.net google.co.uk If your net is down t

Re: [PHP] Checking for internet connection.

2009-12-22 Thread Stuart Dallas
On 21 Dec 2009, at 19:40, Andy Shellam wrote: >> >> Both at home and at work there are caching DNS on the LAN. So a DNS >> request may come back with a valid IP address when the WAN connection is >> down. I still won't be able to connect to the remote site. > > Dig an external server - e.g. dig

RE: [PHP] Checking for internet connection.

2009-12-22 Thread Bob McConnell
From: Andy Shellam >> >> Both at home and at work there are caching DNS on the LAN. So a DNS >> request may come back with a valid IP address when the WAN connection is >> down. I still won't be able to connect to the remote site. > > Dig an external server - e.g. dig @a.root-servers.net google.

RE: [PHP] Checking for internet connection.

2009-12-22 Thread Ashley Sheridan
On Tue, 2009-12-22 at 08:27 -0500, Bob McConnell wrote: > From: Andy Shellam > > >> > >> Both at home and at work there are caching DNS on the LAN. So a DNS > >> request may come back with a valid IP address when the WAN connection > is > >> down. I still won't be able to connect to the remote s

Re: [PHP] Checking for internet connection.

2009-12-22 Thread Kim Madsen
Bob McConnell wrote on 21/12/2009 15:05: Both at home and at work there are caching DNS on the LAN. So a DNS request may come back with a valid IP address when the WAN connection is down. I still won't be able to connect to the remote site. Then use fopen() to read a page you know exists? --

Re: [PHP] Checking for internet connection.

2009-12-22 Thread Andy Shellam
> > I'm confused... what's the problem with just trying to hit the update server? > If you can then you check for updates, if not then you, erm, don't. Simples, > no? True, I think I said this same thing in a previous post - I suggested the DNS option if all the OP wanted to do was check if a

RE: [PHP] Checking for internet connection.

2009-12-22 Thread Bob McConnell
From: Andy Shellam >> >> I'm confused... what's the problem with just trying to hit >> the update server? If you can then you check for updates, if >> not then you, erm, don't. Simples, no? > > True, I think I said this same thing in a previous post - I > suggested the DNS option if all the OP wa

Re: [PHP] Checking for internet connection.

2009-12-22 Thread Andy Shellam
> > And I was pointing out that this would not be a valid test when there is > a caching DNS on the LAN. I also pointed out how to avoid caching issues - the comment was aimed at the author of the message before mine. > > Too much of the conversation and most of the attribution was stripped >

[PHP] File upload directive: $_FILES['filename']['name'] instead of $_FILES['filename']['tmp_name']

2009-12-22 Thread Andrei Iarus
Hello,   On my production & testing servers (production runs on a centrino and testing runs on Windows) I can only access the temporary uploaded file using ini_get( 'upload_tmp_dir' . '/' . $_FILES['filename']['name']; while the file $_FILES['filename']['tmp_name'] simply does not exist (checked

[PHP] OOP: __construct() and "extend"

2009-12-22 Thread APseudoUtopia
Hey list, I'm writing my own class which extends upon the Memcached class (php.net/memcached). I'm a bit confused as to how the constructor works when extending a class. class caching extends Memcached { function __construct() { echo "Caching Class Construct!"; } } For something like the above

Re: [PHP] OOP: __construct() and "extend"

2009-12-22 Thread Jonathan Tapicer
Hey, Constructors behave the same way as regular methods with inheritance, you have to manually call the parent constructor, ie: parent::__construct(). Regards, Jonathan On Tue, Dec 22, 2009 at 7:45 PM, APseudoUtopia wrote: > Hey list, > > I'm writing my own class which extends upon the Memcac

[PHP] TCPDF line breaks

2009-12-22 Thread Dave M G
PHP Users, Anyone using TCPDF? I find that their own forums are near dead. I want to accomplish something simple, but their documentation is far from easy. I have a PDF where I place text in various places around the page, like so: $pdf->SetXY(50, 187); $pdf->Write(0, "hello world"); However,

Re: [PHP] TCPDF line breaks

2009-12-22 Thread Paul M Foster
On Wed, Dec 23, 2009 at 10:40:51AM +0900, Dave M G wrote: > PHP Users, > > Anyone using TCPDF? I find that their own forums are near dead. > > I want to accomplish something simple, but their documentation is far > from easy. > > I have a PDF where I place text in various places around the page

[PHP] DailyWTF - Maybe I Needing Later

2009-12-22 Thread Daevid Vincent
http://thedailywtf.com/Articles/Maybe-I-Needing-Later.aspx You get what you pay for. Ondra M didn't use those exact words, but that's effectively what told his friend and colleague, Derrick. "There's a reason it costs one tenth as much to build in Kerbleckistan," were Ondra's exact words, "there'

Re: [PHP] TCPDF line breaks [SOLVED]

2009-12-22 Thread Dave M G
Paul, Thank you for replying. > I find I have to do $pdf->MultiCell() to accomplish this This turned out to be the command I needed. I used: $pdf->MultiCell(130,30,$text,0); 130 is the width, 30 the height, and the zero at the end means no border (1 is a thin black border). I've never been s

Re: [PHP] OOP: __construct() and "extend"

2009-12-22 Thread Allen McCabe
Extended classes may have their own constructors which are implicitly called, and as Jonathan mentioned, the constructor of any ancestors (ie. the parent) must explicitly be called. If the child (extended) class does NOT have it's own constructor method defined, the parent's constructor is called.