Session's ftp link

<?php
...

session_start();
       function fn1(){
		$source = "name@webserver.com/ftpfiles/sheeta.xlsm";
		$target = fopen("c:/sheeta.xlsm", "w");
		$conn = ftp_connect("ftp.webserver.com") or die("Could not connect");
		ftp_login($conn,"name@webserver.com",'$pass');
		ftp_fget($conn,$target,$source,FTP_ASCII);
		ftp_close($conn);
	}
session_write_close();	
...
?>
	<h2><a href="<?php echo $_SESSION['fn1']; ?>">sheeta.xlsm</a></h2>

I have made a php file with html code in it to connect to my webserver’s ftp capabilites.

Nothing seems to be happening when I click the link. Any suggestions?

What does the link look like in your browser?

session_write_close ends the session, and you never wrote anything out to $_SESSION[‘fn1’].