GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   quick php question? (https://gfy.com/showthread.php?t=804125)

comeplay 01-31-2008 11:57 AM

quick php question?
 
Does this make any sense to any of you?

1. I have a PHP site - it loads all pages referencing < head.inc.php >

2. I need a curl feature to include in the < head.inc.php > file that performs 1 of 2 things.

Step 1 - downloads a webpage that contains YES or NO only from a different server and based on the results either:

(a) result = yes (does nothing - page loads as normal)
(b) result = no (forwards the user to a different website address)

Why 01-31-2008 12:07 PM

yes it makes sense, what do you want to know about it?

Deej 01-31-2008 12:08 PM

of course, its all about if echoing....

Hell House Vic 01-31-2008 12:09 PM

it makes sense. so what's the question?

Why 01-31-2008 12:17 PM

lets see if it will let me write it in here... but you dont need curl at all.
Code:

$url = "url";
$result = file ($url);
if($result = "yes"){
 echo "yes";
}else{
 echo "no";
}

that should work, or something along those lines.

Why 01-31-2008 12:20 PM

Code:

$url = "url";
$result = file ($url);
if($result && $result[0] == "yes"){
 echo "yes";
}else{
 echo "no";
}

sorry, that is better. my bad.

but that would only work if fopen is allowed to get URLs, if not then you still need curl

GrouchyAdmin 01-31-2008 01:00 PM

This whole design is absolutely atrocious and going to cause not only latency through this major bottleneck, but one hell of a point of failure.

If you use file(), or cURL, set a reasonable timeout value.

Hell House Vic 01-31-2008 01:03 PM

why - he'll need curl since the page is on a different server as is a script not a flat file.


All times are GMT -7. The time now is 11:36 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123