FTP Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsSystem AdministrationFTP Help

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 Dev Shed Forums Sponsor:
  #1  
Old June 5th, 2001, 08:52 AM
Vortex Vortex is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2001
Posts: 73 Vortex User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 16 h 8 m 37 sec
Reputation Power: 13
Send a message via ICQ to Vortex
php and ftp

I'm writing a what should be a simple ftp script for users to upload a gif or jpg image.

this is what I have :
PHP Code:
<?php

$ftp_link 
"host";
$ftp_user "username";
$ftp_pass "password";
$ftp_path "web/files/banners/";

if(!
$function) {

}

if(
$function == "upload") {

  function 
_ftpConnect() {
    
$ftp_conn ftp_connect($ftp_link);
    
ftp_login($ftp_conn$ftp_user$ftp_pass);
  return 
$ftp_conn;
}

  
$r _ftpConnect();
  
ftp_chdir($r$ftp_path);

  
$upload ftp_put($r$upfile_name$fileFTP_BINARY);
  
  if(!
$upload) {
  echo 
"FAILED";
  } else {
  echo 
"SUCCESS";
  }

  
ftp_quit($r);
}
?>


My problem is that I get this error : Warning: Unable to find ftpbuf 0

I have no idea what is means and it occurs on the lines with ftp commands accept for ftp_connect.

If someone could tell me what I'm doing wrong or what the error means I would be most grateful
__________________
http://www.myclantemplate.com
We are what we repeatedly do, Excellence then is not something we do but a Habit.

Reply With Quote
  #2  
Old June 5th, 2001, 09:09 AM
Sepodati's Avatar
Sepodati Sepodati is offline
Banned (not really)
Dev Shed God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 1999
Location: Brussels, Belgium
Posts: 14,628 Sepodati User rank is General 51st Grade (Above 100000 Reputation Level)Sepodati User rank is General 51st Grade (Above 100000 Reputation Level)Sepodati User rank is General 51st Grade (Above 100000 Reputation Level)Sepodati User rank is General 51st Grade (Above 100000 Reputation Level)Sepodati User rank is General 51st Grade (Above 100000 Reputation Level)Sepodati User rank is General 51st Grade (Above 100000 Reputation Level)Sepodati User rank is General 51st Grade (Above 100000 Reputation Level)Sepodati User rank is General 51st Grade (Above 100000 Reputation Level)Sepodati User rank is General 51st Grade (Above 100000 Reputation Level)Sepodati User rank is General 51st Grade (Above 100000 Reputation Level)Sepodati User rank is General 51st Grade (Above 100000 Reputation Level)Sepodati User rank is General 51st Grade (Above 100000 Reputation Level)Sepodati User rank is General 51st Grade (Above 100000 Reputation Level)Sepodati User rank is General 51st Grade (Above 100000 Reputation Level)Sepodati User rank is General 51st Grade (Above 100000 Reputation Level)Sepodati User rank is General 51st Grade (Above 100000 Reputation Level)  Folding Points: 97169 Folding Title: Advanced FolderFolding Points: 97169 Folding Title: Advanced FolderFolding Points: 97169 Folding Title: Advanced FolderFolding Points: 97169 Folding Title: Advanced FolderFolding Points: 97169 Folding Title: Advanced Folder
Time spent in forums: 3 Months 6 Days 2 h 39 m 6 sec
Reputation Power: 4375
Send a message via ICQ to Sepodati Send a message via Yahoo to Sepodati
Why do you have your function declaration inside of a conditional? Just define it and call it if you need it.

Where is $function defined? If it's not, then your function is never defined...

Also, if you're going to use outside variables in your function, then you have to make them global.

function whatever()
{
global $this;
global $that;

...

}

etc... May be other things wrong, too, that's the first I noticed. i doubt you are even making a connection, you should check for that first.

---John Holmes...
__________________
-- Cigars, whiskey and wild, wild women. --

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationFTP Help > php and ftp

Developer Shed Advertisers and Affiliates



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 | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap