» Quick Links
You can make money on these forums
We Share profits with you
Google
Google Adsense
Google Adwords
YPN
Yahoo
MSN Search
Web Directories
Web Hosting
Web Hosting Offers
Hosting News
Suggestions
Link Building
Domain Names
PHP Forums
MySQL Forums
» More Links
OSP News
Reseller Hosting
Shared Hosting
Dedicated Servers
Google Adsense
Search Engine Marketing
Link Development
Affiliate Marketing


» Advertising
Multiple DC PR Check

Free SEO Tools


Go Back   Webmaster Forums > Website Developement / Programming > PHP Programming and Tips

PHP Programming and Tips Discuss about PHP programming and Share Tips. Ask questions about Scripting and Errors.

Reply
 
Thread Tools Display Modes
  #1  
Old 08-12-2006, 10:49 AM
kipper kipper is offline
Junior Member
 
Join Date: Aug 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
kipper is on a distinguished road
Default Can FTP sessions be carried to another script?

Some background on the application I want to develop:

Goal: I would like to connect to a remote FTP server after gathering input data from an HTML form. After opening an FTP session, I would like to output a list of files in the directory the user specified. I want the user to pick the file they want to download from the list, and download it.

I have three files currently which I am working on.

1. html form page
2. first php script
3. second php script

The html form is very simple. No problems there.

The first php script is done to the point of displaying a list of files in the directory in a drop down menu, which is a part of a form. The form will send data (the selected file from the list) to the second php script, which will download the file.

Here are my questions:

Is there a better way of getting this done using just one script?
In the second script, I wan -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
Revenue Sharing Ads ( ?):
  #2  
Old 08-12-2006, 10:52 AM
capricorn capricorn is offline
OSP Starters
 
Join Date: Apr 2006
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
capricorn is on a distinguished road
Default

A php script is a file containing PHP code.

2 php scripts can be involved in the answer of a single HTTP query. In that case, the two script can exchange data using function parameters.

But in your case, i have the feeling that your two scripts are meant to react to 2 differents HTTP stimuli. In that case they belong to a different execution line. Variables in PHP does not exist outside of their execution line context, which mean that even a single PHP script cannot share one of its variable with a second call to itself.

When manipulating strings or numbers, it is possible to store the variables in a *global* scope such as sessions, but in your case, the ftp connection is a resource and a resource is not serializable and can't therefore be passed from one execution line to the other

good luck with your project -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
Reply


Thread Tools
Display Modes

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
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
hosting a script? Brodie Web Hosting Industry 2 02-25-2007 12:53 AM
to delete old sessions. Leon MySQL Forums 1 08-03-2006 09:20 AM
Cron with Plesk and PHP Script yogesh PHP Programming and Tips 1 08-01-2006 04:58 PM
script for Yahoo,ICQ & gmail contact listing darwin Yahoo 4 07-31-2006 01:10 PM
page rank script billy Google 2 03-22-2006 09:32 AM


All times are GMT. The time now is 03:36 AM.