|
|
|
|
![]() ![]() |
Oct 29 2005, 03:19 AM
Post
#1
|
|
|
Newbie [Level 2] ![]() ![]() Group: Members Posts: 32 Joined: 25-October 05 Member No.: 13,370 |
Currently i have
CODE <?php if($_POST['user']=="" or $_POST['pass']=="" or $_POST['host']=="" or $_POST['root']=="" or !isset($_POST['run'])){ print('<form method=post name=form>'); print('FTP username <input type=\'text\' name=user value=""><br>'); print('FTP password <input type=\'password\' name=pass value=""><br>'); print('FTP Host <input type=\'text\' name=host value=""><br>'); print('FTP Root Directory <input type=\'text\' name=root value=""><br>'); print('<input type=\'hidden\' name=run value="1">'); print('<input type=\'submit\'>'); }else{ $ftp_server = $_POST['host']; $ftp_user = $_POST['user']; $ftp_pass = $_POST['pass']; $conn_id = ftp_connect($ftp_server) or die("Couldn't connect to $ftp_server please refresh and do not click retry"); // try to login if (@ftp_login($conn_id, $ftp_user, $ftp_pass)) { echo "Connected as $ftp_user@$ftp_server\n"; } else { echo "Couldn't connect as $ftp_user\n please refresh and do not click retry"; } // close the connection ftp_close($conn_id); } ?> currently it has a form and after you fill out the form it logs into the ftp with the user pass and server vars. now i need to know how to get a certian file and edit certian lines of it. any ideas? |
|
|
|
Oct 29 2005, 03:35 AM
Post
#2
|
|
|
Member [Level 1] ![]() ![]() ![]() ![]() Group: Members Posts: 58 Joined: 22-October 05 Member No.: 13,216 |
QUOTE(waterfoul @ Oct 28 2005, 09:19 PM) Currently i have CODE <?php if($_POST['user']=="" or $_POST['pass']=="" or $_POST['host']=="" or $_POST['root']=="" or !isset($_POST['run'])){ print('<form method=post name=form>'); print('FTP username <input type=\'text\' name=user value=""><br>'); print('FTP password <input type=\'password\' name=pass value=""><br>'); print('FTP Host <input type=\'text\' name=host value=""><br>'); print('FTP Root Directory <input type=\'text\' name=root value=""><br>'); print('<input type=\'hidden\' name=run value="1">'); print('<input type=\'submit\'>'); }else{ $ftp_server = $_POST['host']; $ftp_user = $_POST['user']; $ftp_pass = $_POST['pass']; $conn_id = ftp_connect($ftp_server) or die("Couldn't connect to $ftp_server please refresh and do not click retry"); // try to login if (@ftp_login($conn_id, $ftp_user, $ftp_pass)) { echo "Connected as $ftp_user@$ftp_server\n"; } else { echo "Couldn't connect as $ftp_user\n please refresh and do not click retry"; } // close the connection ftp_close($conn_id); } ?> currently it has a form and after you fill out the form it logs into the ftp with the user pass and server vars. now i need to know how to get a certian file and edit certian lines of it. any ideas? I dont know what file you need to get, but you can edit your php file with notepad. |
|
|
|
Oct 29 2005, 03:44 AM
Post
#3
|
|
|
Newbie [Level 2] ![]() ![]() Group: Members Posts: 32 Joined: 25-October 05 Member No.: 13,370 |
QUOTE(wow @ Oct 28 2005, 09:35 PM) i want to have a user fill out a form and it edits a vars.php file in places in that file |
|
|
|
Oct 29 2005, 03:49 AM
Post
#4
|
|
|
Super Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 282 Joined: 30-May 05 From: Bangalore Member No.: 7,686 |
I am not sure if this will help, but I would suggest looking up the official guide for ideas. You can also try looking up this tutorial .
Cheers |
|
|
|
Oct 29 2005, 03:57 AM
Post
#5
|
|
|
Newbie [Level 2] ![]() ![]() Group: Members Posts: 32 Joined: 25-October 05 Member No.: 13,370 |
QUOTE(mama_soap @ Oct 28 2005, 09:49 PM) I am not sure if this will help, but I would suggest looking up the official guide for ideas. You can also try looking up this tutorial . Cheers only help it did was going to the root dir |
|
|
|
Oct 29 2005, 06:21 AM
Post
#6
|
|
|
Privileged Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 874 Joined: 30-July 04 Member No.: 246 |
I would suggest looking up the reference provided. It explains everything you need to know about using the FTP protocol with PHP. There isn't really anything anyone else can tell you that isn't already contained within the official manual, so try reading about some of the functions and features.
|
|
|
|
Nov 20 2006, 11:10 PM
Post
#7
|
|
|
Newbie [Level 2] ![]() ![]() Group: Members Posts: 25 Joined: 20-November 06 Member No.: 33,763 |
well chnage the parts u hav 2 change basically such as "FTP Username"
|
|
|
|
![]() ![]() |
Similar Topics
|