473,404 Members | 2,179 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

Calling an FTP location in PHP

This (im hoping) is an easy problem to solve!
Quite simply, i have a HTML login form, where users can type their
usernames and passwords for an FTP server of mine.

The code im using is;

<?
//set variables for form values of previous page to make next code
easier.
$user = $_POST['user'];
$pass = $_POST['pass'];
$login = "Location: ftp://{$user}:{$*****@12.34.5.67/";
header( "$login" );

?>

User and Pass are boxes on the form before hand, and all works fine-
however, the page this opens is a list of files that are inside that
ftp location- instead of a 'folder view' that you usually get with most
modern versions of windows. You can easily get to the folder view by
hitting refresh when the file list shows up, but this ideally isnt what
i want.

So is there another method of calling that page so that it goes
straight to folder view? Maybe opening it up in another window would
work, but how would i do that?

Any help would be greatfully recieved as ive only really just got into
PHP :)
Darren.

Jan 16 '06 #1
4 1282
da********@gmail.com wrote:
So is there another method of calling that page so that it goes
straight to folder view? Maybe opening it up in another window would
work, but how would i do that?


No, this is something the client should modify on his/her machine by
changing the folder options. Not PHP related...
JW
Jan 16 '06 #2

Janwillem Borleffs wrote:
da********@gmail.com wrote:
So is there another method of calling that page so that it goes
straight to folder view? Maybe opening it up in another window would
work, but how would i do that?


No, this is something the client should modify on his/her machine by
changing the folder options. Not PHP related...
JW


Well, at first, it would just load up a "page nopt found error" then
you hit refresh and it works? Its definately something to do with the
header function- is there any other functions available to call a page?
preferably in a new windo or something?

Darren.

Jan 16 '06 #3
FingAZ schrieb:
Janwillem Borleffs wrote:
da********@gmail.com wrote:
So is there another method of calling that page so that it goes
straight to folder view? Maybe opening it up in another window would
work, but how would i do that?


No, this is something the client should modify on his/her machine by
changing the folder options. Not PHP related...
JW

Well, at first, it would just load up a "page nopt found error" then
you hit refresh and it works? Its definately something to do with the
header function- is there any other functions available to call a page?
preferably in a new windo or something?

Darren.


Client-side redirect: In the form action attribute call a script, call
it for example "ftplogin.php"; you can use the target attribute in order
to open a new window.

ftplogin.php then will be something like:

<?php
$url = "ftp://".$_POST['user'].":".$_POST['pass']."@12.34.5.67/";
?>
<html>
<head>
<meta http-equiv="refresh" content="0; URL=<?php echo $url; ?>">
</head>
<body>
If you are not redirected automatically click
<a href="<?php echo $url; ?>">here!</a>
</body>
</html>

HTH
Markus
Jan 16 '06 #4
<snip>
Client-side redirect: In the form action attribute call a script, call
it for example "ftplogin.php"; you can use the target attribute in order
to open a new window.

ftplogin.php then will be something like:

<?php
$url = "ftp://".$_POST['user'].":".$_POST['pass']."@12.34.5.67/";
?>
<html>
<head>
<meta http-equiv="refresh" content="0; URL=<?php echo $url; ?>">
</head>
<body>
If you are not redirected automatically click
<a href="<?php echo $url; ?>">here!</a>
</body>
</html>

HTH
Markus


Argh! It does work- but still just displays the file list and needs for
the user to hit F5 :(
I blame micro$uck lol any more ideas?

Darren.

Jan 16 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: johny smith | last post by:
I am trying to figure out a way to print the address of what called a certain function once inside the function. I am assuming that this information is on the stack somewhere. But can someone...
18
by: Simula | last post by:
I am developing an HTML javascript application and I want to preserve state in a way that can be book-marked. I chose HTML anchors as a means of preserving state. When the application changes...
2
by: mark | last post by:
I am developing an application in .Net C# that needs to restore a number of tool windows to some previous location and size. The problem I have is that when I create the form and set the Location...
3
by: Jerome Cohen | last post by:
AI am trying to call a third-party web service. this service expects an XML fragment that contains the request plus other parameter. adding the web reference created the syntax below(reference.vb)....
0
by: teddysnips | last post by:
I have Search form that allows users to retrieve records into a DataGrid. There are two search criteria - a Month and a Year, which are selected from drop-down lists. There is a server-side...
0
by: teddysnips | last post by:
I have Search form that allows users to retrieve records into a DataGrid. There are two search criteria - a Month and a Year, which are selected from drop-down lists. There is a server-side...
1
by: Jake Barnes | last post by:
I can not figure out the meaning of this error: Error: " nsresult: "0x8057001e (NS_ERROR_XPC_JS_THREW_STRING)" location: "JS frame :: http://www.bluecasts.com/pdsIncludes/pdsAjax.js ::...
7
by: jomcfall97 | last post by:
hey wondering if anyone can help me with some work im doing im trying to remove a record from a queue by using a method from a class. class QueueNode { private String document ; private String...
8
by: Derek Hart | last post by:
I am unclear about what all the requirements are to call a simple vb.net application, installed in the GAC, from COM (such as writing vba in Word to call the dotnet dll). I believe I have...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.