User not logged in - login - register
Home Calendar Books School Tool Photo Gallery Message Boards Users Statistics Advertise Site Info
go to bottom | |
 Message Boards » » ftp in php/mysql Page [1]  
robster
All American
3545 Posts
user info
edit post

Hey all you php gurus!

I need some direction in figuring out a problem. I want to make a php/html page that allows me to click a button for a certain row in a dynamic table (each row will have this button) and when I click the button, it will open a new text file, and write to it the comma separated values for each column in the database that pertain to that row, and then ftp that file to an external server.

Does anyone have knowledge as to how I might go about doing this. I know I have to use php's ftp function set, but I cant figure out how do the the file creation, because I dont really want to save the text file anywhere, but just create it and ftp it, and after that, I could care less that it exists, and would prefer that it didnt get saved because that will just take up space.

Thanks!!

1/31/2006 9:32:21 AM

scrager
All American
9481 Posts
user info
edit post

save, ftp, delete?
that's the easy solution.

1/31/2006 11:51:43 AM

Noen
All American
31346 Posts
user info
edit post

You really need to use your filestream functions.

fopen a new file
write the content to it

open ftp stream
fput the file handle
close ftp stream

fclose the file
unlink the file.


It should be done like for a number of security and data integrity reasons.

1/31/2006 1:15:24 PM

robster
All American
3545 Posts
user info
edit post

cool... that is the pattern I was looking for, but just wasnt sure if it could be done successfully without saving the file somewhere.

I guess if you just use the same file name over and over and keep opening it as an empty file though, it should be fine this way, right?

1/31/2006 3:13:34 PM

 Message Boards » Tech Talk » ftp in php/mysql Page [1]  
go to top | |
Admin Options : move topic | lock topic

© 2024 by The Wolf Web - All Rights Reserved.
The material located at this site is not endorsed, sponsored or provided by or on behalf of North Carolina State University.
Powered by CrazyWeb v2.38 - our disclaimer.