SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot
    Join Date
    Sep 2010
    Posts
    131
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Session's ftp link

    Code:
    <?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?

  2. #2
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,508
    Mentioned
    163 Post(s)
    Tagged
    4 Thread(s)
    What does the link look like in your browser?

  3. #3
    Keeper of the SFL StarLion's Avatar
    Join Date
    Feb 2006
    Location
    Atlanta, GA, USA
    Posts
    3,748
    Mentioned
    73 Post(s)
    Tagged
    0 Thread(s)
    session_write_close ends the session, and you never wrote anything out to $_SESSION['fn1'].
    Never grow up. The instant you do, you lose all ability to imagine great things, for fear of reality crashing in.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •