Download a file using ftp

I want to be able to download a file to a person who is accessing my website. My question is: I have a webserver that has a public_ftp folder (“http://www.webserver.com/path/public_ftp/source.txt”). Would that be the same as “ftp.testftp.com” listed below?

<?php
$conn = ftp_connect("ftp.testftp.com") or die("Could not connect");
ftp_login($conn,"admin","ert456");

echo ftp_get($conn,"C://target.txt","source.txt",FTP_ASCII);

ftp_close($conn);
?>

I also found this. Which is better?

<?php
$source = "source.txt";
$target = fopen("target.txt", "w");

$conn = ftp_connect("ftp.testftp.com") or die("Could not connect");
ftp_login($conn,"admin","ert456");

ftp_fget($conn,$target,$source,FTP_ASCII);

ftp_close($conn);
?>

I dont… quite think you’ve got the idea of how PHP works.

You cannot put files onto another person’s computer using PHP, unless THEY are running an FTP server. If you could, people would be force-fed viruses so often that the internet would cease to exist. PHP does not execute on the user’s machine; it executes on the server.