PHP Installation
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP RelatedPHP Installation

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th-1:00PM EST. Register Today!
  #1  
Old February 10th, 2004, 08:16 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
some help uploading php via ftp

i am trying to upload the following code to my webspace but i am having no joy, this is my first attempt at php and this last bit has puzzled me.

i am hosting a site with t35.com and i am trying to upload this code via smartftp.

can anyone show me how to do this properly please..


Code:
 
<? 
// This function check the ftp status and return true (online) or false (offline) 
function is_online($server='localhost',$port=80,$timeout=20  ) { 
    $fp = @fsockopen($server, $port, &$errno, &$errstr, $timeout); 

    if (!$fp) 
        return false; 
    else 
    { 
        fclose($fp); 
        return true; 
    } 
} 
header("Content-type: image/gif"); 
   if (is_online('mediastorage.no-ip.info',10010) == true) { 
      // Display online image 
      readfile("images/sonline.gif"); 
   } else { 
      // Display offline image 
      readfile("images/soffline.gif"); 
   } 
?>  



--------------------------------------------------------------------------------
In this tutorial i will explain how you can show the f*p on/offline status as a included image.

Requirements:
Webspace -> must support PHP

2 images (one for online, one for offline) in a folder named "images"

Example:
Online:

Offline:


This is the code of the status.php


Code:
 
<? 
// This function check the fp status and return true (online) or false (offline) 
function is_online($server='localhost',$port=80,$timeout=2)   { 
    $fp = @fsockopen($server, $port, &$errno, &$errstr, $timeout); 

    if (!$fp) 
        return false; 
    else 
    { 
        fclose($fp); 
        return true; 
    } 
} 
header("Content-type: image/gif"); 
   if (is_online("www.somesite.com,21) == true) { 
      // Display online image 
      readfile("images/sonline.gif"); 
   } else { 
      // Display offline image 
      readfile("images/soffline.gif"); 
   } 
?>  
 

change www.somesite.com into the ip or url to your f*p server 

Now upload status.php to your webspace and include it like this: 
["img"]http://www.yourwebspace.com/status.php["/img"] (without ") 

 < XXXXXXXXX server use his as an example coz mine is not up an running yet 


thanks in advance

Reply With Quote
  #2  
Old February 12th, 2004, 09:53 PM
Nicky's Avatar
Nicky Nicky is offline
Contributing User
Codewalkers Novice (500 - 999 posts)
 
Join Date: Apr 2007
Location: Neverland
Posts: 606 Nicky User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 3 m 26 sec
Reputation Power: 2
RE: some help uploading php via ftp

Are you out of the demo time for smartftp?

Reply With Quote
  #3  
Old February 12th, 2004, 10:06 PM
nawlej nawlej is offline
Contributing User
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: Dallas, Tx. USA
Posts: 2,008 nawlej User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 h 7 m 51 sec
Reputation Power: 4
RE: some help uploading php via ftp

Try it on the command line:

http://unix.about.com/library/weekly/aa121800a.htm?once=true&

Thats written for unix, but will work on a windows command line as well.

Reply With Quote
  #4  
Old April 21st, 2004, 01:13 AM
mhdrw00 mhdrw00 is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 2 mhdrw00 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: some help uploading php via ftp

I need a mod to contact me about some information in this post. There is information in this post that should NOT be used!!!!!!!!

Reply With Quote
  #5  
Old April 21st, 2004, 01:21 AM
CodeKadiya CodeKadiya is offline
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: Colombo,Sri Lanka
Posts: 2,313 CodeKadiya User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 4
Send a message via Yahoo to CodeKadiya
RE: RE: some help uploading php via ftp

Quote:
I need a mod to contact me about some information in this post. There is information in this post that should NOT be used!!!!!!!!

WAIT! As soon as an Admin logs in they'll take an action on this. Don't worry! Super Users can't do anything about this.

Admins Look here : http://codewalkers.com/forum/index.php?action=displaythread&forum=general&id=524&realm=default

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Installation > some help uploading php via ftp


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway