[PHP] Help Reading Data |
|
06-28-2012, 04:21 PM
(This post was last modified: 06-28-2012 04:23 PM by BreShiE.)
|
|||
|
|||
|
[PHP] Help Reading Data
Okay, well I'm trying to grab the response of a website, and tell the document that if it returns "404" then to echo online, and if not to echo offline. The code I've got works, but I can put if it equals to anything, it'll still say "online". I want it to echo "Offline" if it doesn't return the string "404".
Here's my code: PHP Code: (SELECT ALL CODE) <?PHPAny help's appreciated. |
|||
|
06-28-2012, 04:25 PM
|
|||
|
|||
|
RE: [PHP] Help Reading Data
Unfortunately I'm not to familiar with curl. I will try to find some time to look at this when I'm off work.
|
|||
|
06-28-2012, 04:43 PM
|
|||
|
|||
|
RE: [PHP] Help Reading Data
It doesn't have to be cURL, I just though that'd be the easiest way to do it.
|
|||
|
06-28-2012, 08:56 PM
|
|||
|
|||
|
RE: [PHP] Help Reading Data
Never used curl other than in the command line from a curl binary, but it is definitely a good tool.
![]() Microsoft MVP .NET Programming - (2012 - Present) ®Crestron DMC-T Certified Automation Programmer Development Site: aceinfinity.net |
|||
|
06-28-2012, 09:47 PM
|
|||
|
|||
|
RE: [PHP] Help Reading Data
So you guys have nothing to offer me? D:
I don't have to use CURL... |
|||
|
06-29-2012, 06:22 AM
(This post was last modified: 06-29-2012 06:23 AM by Florin.)
|
|||
|
|||
|
RE: [PHP] Help Reading Data
I don't know quite good php, but shouldn't be like this:
PHP Code: (SELECT ALL CODE) $data == "404" ?? Thanks! |
|||
|
06-29-2012, 07:33 AM
|
|||
|
|||
RE: [PHP] Help Reading Data
(06-29-2012 06:22 AM)florin Wrote: I don't know quite good php, but shouldn't be like this: You know what's hilarious? That actually fixed it, haha! Thanks. |
|||
|
06-29-2012, 10:10 AM
|
|||
|
|||
|
RE: [PHP] Help Reading Data
Ha! Florin.you're.awesome.
Man. I was overshadowed by my 'unknowing' of curl, that I completely overlooked that. I should have seen that. Good thing you got it working. |
|||
|
06-29-2012, 07:45 PM
|
|||
|
|||
|
RE: [PHP] Help Reading Data
Ahh, see I was in KoBE's same boat here, but to be honest I didn't even actually look at the PHP script you had because of the lack of time I had that day. I'm off in another 30mins/1hour to do something today, but then i'm good for time on the weekend. Unless something else comes up.
= is an assignment operator == is used for comparison ![]() Microsoft MVP .NET Programming - (2012 - Present) ®Crestron DMC-T Certified Automation Programmer Development Site: aceinfinity.net |
|||
| Users browsing this thread |
| 1 Guest(s) |










