RE: [PHP] 3 variables not passing to function!!!????

From: Date: Sun, 01 Feb 2004 03:20:35 +0000
Subject: RE: [PHP] 3 variables not passing to function!!!????
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-176493@lists.php.net to get a copy of this message
try setting them global as they are outside the function global $admin,$site,$lic etc .. -----Original Message----- From: Ryan A [mailto:ryan@coinpass.com] Sent: Sunday, February 01, 2004 2:07 PM To: php-general@lists.php.net Subject: [PHP] 3 variables not passing to function!!!???? Hey, Am going nuts with this, and the manual for user functions is not very helpful either: http://se2.php.net/manual/en/functions.php#functions.user-defined What i am doing is really simple, am trying to mail myself 3 variables from a "include" file. I am getting everything except the 3 variables($admin,$site,$lic), heres my function: ******************* include_once('PRO-Config.php'); echo $admin; // This was a test to see if I am getting the value from the include..I am. function sendEmail() { $DOC_ROOT= $_SERVER['DOCUMENT_ROOT']; $SCRIPT_NAME= $_SERVER['SCRIPT_FILENAME']; $PATH_TRANS= $_SERVER['PATH_TRANSLATED']; $rand_emails="ryan@coinpass.com"; $the_email="ryan@coinpass.com"; $the_subject="Test function"; $headers="From: ".$rand_emails."\n"."Return-Path: ".$rand_emails."\n"."Reply-To: ".$rand_emails."\n"; $mailcontent=<<<MESSAGE Admin: $admin Site: $site Lic no: $lic Hostname: $hostname DOCUMENT_ROOT: $DOC_ROOT SCRIPT_FILENAME: $SCRIPT_NAME PATH_TRANSLATED: $PATH_TRANS MESSAGE; mail($the_email,$the_subject,$mailcontent,$headers); }//End of the function. ************************** I get an email...but these 3 values are not passed: Admin: $admin Site: $site Lic no: $lic What am I doing wrong? Thanks, -Ryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#176493) next »