![]() |
![]() |
![]() |
||||
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 |
Shit... Fuck! What the Hell?
Industry Role:
Join Date: Dec 2003
Posts: 7,567
|
anything wrong with my code.. php
PHP Code:
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
ICQ:649699063
Industry Role:
Join Date: Mar 2003
Posts: 27,763
|
Run...
![]()
__________________
Send me an email: [email protected] |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Shit... Fuck! What the Hell?
Industry Role:
Join Date: Dec 2003
Posts: 7,567
|
are you ok?
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
ICQ:649699063
Industry Role:
Join Date: Mar 2003
Posts: 27,763
|
Are you a bot?
__________________
Send me an email: [email protected] |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Confirmed User
Industry Role:
Join Date: Aug 2006
Location: Poland
Posts: 9,228
|
looks ok.
__________________
Mechanical Bunny Media Mechbunny Tube Script | Mechbunny Webcam Aggregator Script | Custom Web Development |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
Confirmed User
Industry Role:
Join Date: Aug 2006
Location: Poland
Posts: 9,228
|
no wait. You cant do file_exists on a url, only a linux path. I knew it was a trick question!
__________________
Mechanical Bunny Media Mechbunny Tube Script | Mechbunny Webcam Aggregator Script | Custom Web Development |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 |
Do Fun Shit.
Industry Role:
Join Date: Dec 2004
Location: OC
Posts: 13,393
|
I've run into a few issues on file_exists not working on big movie files also... I believe approaching 2-3 gb limits.
__________________
![]() “I have the simplest tastes. I am always satisfied with the best.” -Oscar Wilde |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 |
Confirmed User
Join Date: Sep 2003
Posts: 708
|
Looks like the beginnings of a tube script.
__________________
"You can get more with a kind word and a gun than you can with a kind word alone.” |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 |
Confirmed User
Join Date: Sep 2003
Posts: 708
|
Code:
$url="http://www.site.com/video.flv"; $fp = fopen('$url', 'r'); if($fp) { $filename="$url"; fclose($fp); }
__________________
"You can get more with a kind word and a gun than you can with a kind word alone.” |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#11 |
Confirmed User
Join Date: Oct 2008
Posts: 344
|
Yeah, there's no sense in using the resources to open the file just to check for its existence and also (I haven't done anything in PHP for years so I may be wrong) I think fopen() by default doesn't allow you to open up URLs for security reasons.
To the OP, as konrad said, replace the $url with the local FS path and it should be fine. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#12 |
Confirmed User
Industry Role:
Join Date: Aug 2006
Location: Poland
Posts: 9,228
|
Don't do this. Not only will this use a whole lot of ram, it will download the file over http first.
__________________
Mechanical Bunny Media Mechbunny Tube Script | Mechbunny Webcam Aggregator Script | Custom Web Development |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#13 |
Registered User
Industry Role:
Join Date: Aug 2003
Location: QWEBEC Corporate Office
Posts: 7,124
|
TRY :
$file = "full/server/path/to/file/video.mp4" ; $url = "http://somedomain.com/" ; IF (file_exists( $file)) { $filename = $url/video.mp4'; } ELSE { $filename = $url/video.flv'; } |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#14 |
Beer Money Baron
Industry Role:
Join Date: Jan 2001
Location: brujah / gmail
Posts: 22,157
|
Code:
$filename = $url.'video.mp4'; $ch = curl_init($filename); curl_setopt($ch, CURLOPT_NOBODY, TRUE); curl_exec($ch); $ret = curl_getinfo($ch, CURLINFO_HTTP_CODE); if ($ret >= '400') { $filename = $url.'video.flv'; } curl_close($ch);
__________________
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#15 |
Too lazy to set a custom title
Industry Role:
Join Date: Dec 2004
Location: Happy in the dark.
Posts: 92,989
|
__________________
FLASH SALE INSANITY! deal with a 100% Trusted Seller Buy Traffic Spots on a High-Quality Network 1 Year or Lifetime — That’s Right, Until the Internet Explodes! |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#17 |
Too lazy to set a custom title
Join Date: Mar 2002
Location: Australia
Posts: 17,393
|
It's a strange way to do things, but I don't think it would download the entire file. At most it would read the response and a few K of data until the buffer becomes full.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#18 |
Confirmed User
Industry Role:
Join Date: Jul 2005
Location: Beck's City, North Teutonia
Posts: 3,185
|
__________________
There aren't enough faces and palms on this planet for an appropriate reaction to religion. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#19 |
:glugglug
Join Date: Mar 2003
Location: Where the Wild Things Are
Posts: 26,118
|
Too much chinese, ching chang kling kong.
|
![]() |
![]() ![]() ![]() ![]() ![]() |