-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Christopher Taylor
Sent: 18 October 2005 15:36
To: [email protected]
Subject: Re: [newbie] php to html or pdf

On 10/18/05, Tony S. Sykes <[EMAIL PROTECTED]> wrote:
-----Original Message-----
From: [EMAIL PROTECTED] [mailto: [EMAIL PROTECTED]]On Behalf Of Christopher Taylor
Sent: 18 October 2005 15:00
To: [email protected]
Subject: Re: [newbie] php to html or pdf

Sorry abouty that.  You can use an fprintf to write to a file.  Just write the output of the script to a file as welll as to the screen.  The script can email the file as an attachment.  The script can alo do the ftp.

--
Christopher Taylor - Registered Linux User #383327  
 
 
lol, don't apologise Chris, not sure that will work looking at the man page. I'll tell you what I have got so far as that might help. I run a few scripts to collect info from a server, this creates some graphs as png's that are used in some php pages that I publish on my internal web site. It is only internal as my company are funny with internal and external connections. What I want to do is add a bit to the end of the script so that I can create a file, that I will then ftp to a server that will publish the html/pdf for external customers and also send an email to a few people.
 
Thanks,
 
Tony.


Tony,

It is an intersting project.  I have done some work having the php script write out an htmll file.  In this case, there was a database table and I had a script that dumped the data to an html file with a table (no images).  I have also done a number of scripts that involve emailing.  I haven't tried the ftp yet.  I think that is probably the biggest hurdle.  The other two are pretty straight forward.  Here is a code snippet that I took from the php site, I think you would need separate puts for each html and png file:

<?php
// set up basic connection
$conn_id = ftp_connect($ftp_server);

// login with username and password
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);

// check connection
if ((!$conn_id) || (!$login_result)) {
       echo
"FTP connection has failed!";
       echo
"Attempted to connect to $ftp_server for user $ftp_user_name";
       exit;
   } else {
       echo
"Connected to $ftp_server, for user $ftp_user_name";
   }

// upload the file
$upload = ftp_put($conn_id, $destination_file, $source_file, FTP_BINARY);

// check upload status
if (!$upload) {
       echo
"FTP upload has failed!";
   } else {
       echo
"Uploaded $source_file to $ftp_server as $destination_file";
   }

// close the FTP stream
ftp_close($conn_id);
?>


--
Christopher Taylor - Registered Linux User #383327  
 
 
Thanks, for that but that is more than I need, I have a simple bash script that takes care of collecting data moving it around and creating graphs (also doing other things if triggers are met). The php part is just the display of the information, I just want to be able to make the output of the php file static at the point I run it so I can add mail and ftp to the script. 
 
Thanks,
 
Tony. 


-+-+-+-+-+-+-+-+-+ Business Computer Projects - Disclaimer -+-+-+-+-+-+-+-+-+-
This message, and any associated attachment is confidential. If you have received
it in error, please delete it from your system, do not use or disclose the information
in any way, and notify either the sender or [EMAIL PROTECTED] immediately.
The contents of this message may contain personal views which are not necessarily
the views of Business Computer Projects Ltd., unless specifically stated. Whilst every
effort has been made to ensure that emails and their attachments are virus free, it is
the responsibility of the recipient(s) to verify the integrity of such emails.
Business Computer Projects Ltd
BCP House
151 Charles Street
Stockport
Cheshire
SK1 3JY
Tel: +44 (0)161 355-3000
Fax: +44 (0)161 355-3001
Web: http://www.bcpsoftware.com

Reply via email to