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.

Coding Forum


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



Reply
I am trying to make....
Old 03-17-2005, 10:02 PM I am trying to make....
sk8boarder2424's Avatar
Extreme Talker

Posts: 175
Location: Lockport Illinois
Trades: 0
I am trying to make a page that would be similar to opening an ftp url in firefox...
i want to make an HTML page that can lsit the contents of its root folder....
om this case the /files folder i have on my webserver anyway to do it without messing with databases or leaving the .htm file format, and keeping it an http:// document?

Thanks in advance,
-matt
__________________
"People created God in an effort to explain the unknown and soothe their fear of death."

-beasters
sk8boarder2424 is offline
Reply With Quote
View Public Profile Visit sk8boarder2424's homepage!
 
 
Register now for full access!
Old 03-17-2005, 10:31 PM
Republikin's Avatar
Defies a Status

Posts: 3,189
Trades: 3
Yes, although with all those requirements it's not going to be easy.

First, you need to create a .htaccess file and put this in it...

Code:
AddType application/x-http-php .htm .html .php
Then place that in the directory where this script will reside. Next you can create an ftp client using php's built in FTP functions.

Something like this should give you a basic idea...

PHP Code:
<?php
// set up basic connection
$conn_id ftp_connect($ftp_server);

// login with username and password
$login_result ftp_login($conn_id$ftp_user_name$ftp_user_pass);

// check connection
if ((!$conn_id) || (!$login_result)) {
       echo 
"FTP connection has failed!";
       echo 
"Attempted to connect to $ftp_server for user $ftp_user_name";
       exit;
   } else {
       
$ftp_nlist ftp_nlist($conn_id$dir_to_list);
       foreach(
$ftp_nlist as $res) {
           echo 
$res '<br />';
       }
   }

ftp_close($conn_id);
?>
Put that somewhere in your .htm document and with the .htaccess file it should work.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Republikin is offline
Reply With Quote
View Public Profile
 
Old 03-18-2005, 04:27 PM
sk8boarder2424's Avatar
Extreme Talker

Posts: 175
Location: Lockport Illinois
Trades: 0
hmmm, not exactly what i was thinking of, but it should work just fine
thanks!
__________________
"People created God in an effort to explain the unknown and soothe their fear of death."

-beasters
sk8boarder2424 is offline
Reply With Quote
View Public Profile Visit sk8boarder2424's homepage!
 
Reply     « Reply to I am trying to make....
 

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 1.10474 seconds with 12 queries