Click to See Complete Forum and Search --> : --enable-ftp ???


strBean
02-22-2006, 01:07 PM
I'm adding a feature to a very simple web forum, to allow users to attach a file to their post. I have set up an additional ftp login with my host server, I've set the chmod to 777 on the directory that it points to, and now I've got some code. I get the error "call to undifined function: ftp_connect()"...

I see in the php manual (http://us3.php.net/manual/en/ref.ftp.php) that it says to "add the --enable-ftp option when installing PHP 4 or greater".

Does the error mean this is something I need to do?

If so, how? Add a line to my .htaccess file? If so, how?

strBean
02-22-2006, 01:45 PM
This is what it says:
In order to use FTP functions with your PHP configuration, you should add the --enable-ftp option when installing PHP 4 or greater or --with-ftp when using PHP 3.

I'm using my own copy of PHP 5. It could be that I need to add a line to my php.ini file. I called my hosting service, not much help.

Anybody ever had ftp_connect() generate an "undefined" error?

Sheldon
02-22-2006, 02:08 PM
why ftp? Why not upload the file?move_uploaded_file (http://php.net/move_uploaded_file)

strBean
02-22-2006, 02:14 PM
Sorry, *****ious newbie here.

I don't need ftp to offer users the chance to upload a file? What do I call to upload the file, before I move it with move_uploaded_file()?

strBean
02-22-2006, 02:15 PM
ps. Censored?? What is so nasty about "a m b i t"?

Sheldon
02-22-2006, 02:27 PM
with a form, use a <input type="file"> then your form processing will involve the move_uploaded_file();

strBean
02-22-2006, 02:32 PM
Geez. Seems easy. 2 arguments.
For filename and destination, do I use the full path for both of them?