Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Last http file was modified
Old 12-31-2005, 12:43 PM Last http file was modified
Experienced Talker

Posts: 32
Trades: 0
Hey Folks i am tryin go use this code snipped that i got from php.net to return the date the last modified time of this file but to no avail can someone help me plesae thank you.

PHP Code:
<?PHP


function filemtime_remote($uri)
{
   
$uri parse_url($uri);
   
$handle = @fsockopen($uri['host'],80);
   if(!
$handle)
       return 
0;

   
fputs($handle,"GET $uri[path] HTTP/1.1\r\nHost: $uri[host]\r\n\r\n");
   
$result 0;
   while(!
feof($handle))
   {
       
$line fgets($handle,1024);
       if(!
trim($line))
           break;

       
$col strpos($line,':');
       if(
$col !== false)
       {
           
$header trim(substr($line,0,$col));
           
$value trim(substr($line,$col+1));
           if(
strtolower($header) == 'last-modified')
           {
               
$result strtotime($value);
               break;
           }
       }
   }
   
fclose($handle);
   return 
$result;
}
$filename filemtime_remote('http://sis.rpi.edu/reg/zs200601.txt');
 echo 
"$filename was last modified: " date ("F d Y H:i:s."filemtime($filename));

?>
Thank you
rcubes85 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 12-31-2005, 06:36 PM
Experienced Talker

Posts: 32
Trades: 0
Assistance can someone assist me please that would be greatly appreciated
rcubes85 is offline
Reply With Quote
View Public Profile
 
Old 12-31-2005, 08:47 PM
Anacrusis's Avatar
Defies a Status

Posts: 2,099
Name: Adam
Location: Colchester CT
Trades: 0
It might help if you provided any error messages your receiving or describe any symptoms of the problem you are experiencing.
Anacrusis is offline
Reply With Quote
View Public Profile
 
Old 01-01-2006, 12:52 AM
Experienced Talker

Posts: 32
Trades: 0
I found the solution thanks for those who tried to help. Someone else help me with it thanks again

PHP Code:
 $fn 'http://sis.rpi.edu/reg/zs200601.txt';
echo 
basename($fn).' was last modified: '.date("F d Y H:i:s."filemtime_remote($fn)); 
rcubes85 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Last http file was modified
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.42810 seconds with 12 queries