![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Join Date: Nov 2004
Location: Greater Washington DC
Posts: 1,435
|
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)
__________________
Top virtual hosts for under 10$? www.hostmylife.com | icq 50663030 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
MFBA
Industry Role:
Join Date: Mar 2003
Location: PNW
Posts: 7,230
|
yes it makes sense, what do you want to know about it?
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
I make pixels work
Industry Role:
Join Date: Jun 2005
Location: I live here...
Posts: 24,386
|
of course, its all about if echoing....
__________________
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Pay to Cum
Join Date: Aug 2004
Location: Nor San Diego
Posts: 1,029
|
it makes sense. so what's the question?
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
MFBA
Industry Role:
Join Date: Mar 2003
Location: PNW
Posts: 7,230
|
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"; } |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
MFBA
Industry Role:
Join Date: Mar 2003
Location: PNW
Posts: 7,230
|
Code:
$url = "url"; $result = file ($url); if($result && $result[0] == "yes"){ echo "yes"; }else{ echo "no"; } but that would only work if fopen is allowed to get URLs, if not then you still need curl |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 |
Now choke yourself!
Industry Role:
Join Date: Apr 2006
Posts: 12,085
|
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.
__________________
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 |
Pay to Cum
Join Date: Aug 2004
Location: Nor San Diego
Posts: 1,029
|
why - he'll need curl since the page is on a different server as is a script not a flat file.
|
![]() |
![]() ![]() ![]() ![]() ![]() |