[Techtalk] php scripting...
Diggy Bell
diggy at dbsoftdev.com
Mon Sep 30 08:53:02 EST 2002
Walt,
There is a PHP function 'mail()' that can be used to send mail from your PHP
script. After you have processed the file, consider the following steps:
1. Construct a string containing the message and any form/submission
variables that you want. For example:
//
// Assume you have created these global vars...
//
global $ipaddr, $filename;
$hostname = gethostbyaddr($ipaddr); // try to get the hostname if you can
$string = "Uploaded file ($filename) from from $hostname [$ipaddr]";
//
// mail(to, subject, message, [headers, parameters]);
//
mail("myself at mydomain.com", "File Upload Notice", $string, "From:
notify at mydomain.com\r\n");
For all the details on mail(), check here:
http://www.php.net/manual/en/function.mail.php
William D. 'Diggy' Bell
Principal
DB Software Development
http://www.dbsoftdev.com
----- Original Message -----
From: "Walt" <pippin at freeshell.org>
To: <techtalk at linuxchix.org>
Sent: Monday, September 30, 2002 8:35 AM
Subject: [Techtalk] php scripting...
> I've modified a PHP script to allow users to
> upload files to me.
>
> The source of it is here:
>
> http://mercersburg.net/upload/upload.txt
>
> I would like to add a feature to it, namely
> that it would email me when a user successfully
> uploads the file, including the user's IP and/or
> other form fields if possible...
>
> Any suggestions/tips?
>
> Thanks in advance... :-)
>
> Walt
>
> -~
>
> Economy is going without something you do want in
> case you should, some day, want something you
> probably won't want.
> Anthony Hope
>
> _______________________________________________
> Techtalk mailing list
> Techtalk at linuxchix.org
> http://mailman.linuxchix.org/mailman/listinfo/techtalk
>
More information about the Techtalk
mailing list