|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
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
|
|||
|
|||
|
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 |
|
#2
|
||||
|
||||
|
RE: some help uploading php via ftp
Are you out of the demo time for smartftp?
|
|
#3
|
|||
|
|||
|
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. |
|
#4
|
|||
|
|||
|
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!!!!!!!!
|
|
#5
|
|||
|
|||
|
RE: RE: some help uploading php via ftp
Quote:
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 |
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Installation > some help uploading php via ftp |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|