On 04 June 2008 16:03, Yui Hiroaki advised:

> NO!
> That is what I do not want!
> setting.php need to run mail() function.
> also setting.php need $googlemapkey.
> 
> other.php just need $googlemapkey.
> other .php do not need run mail() function.
> 
> If I use "include", I will get twice email.

Same answer as Thijs gave, just with the filenames moved around:

 google_info.php
 <?php
    $googlemapkey = "g8ejeUFEUHEU";// example

    function sendMail() {
        mail("[EMAIL PROTECTED]","test"."test");
    }
 ?>


 setting.php
 <?php
    include "google_info.php";

    sendMail();  // sends mail

    // other stuff using your google API key
 ?>

 other.php
 <?php
   include "google_info.php";

    // use your google API key any way you want
    // ... but no call to sendMail()
 ?>

Cheers!

Mike

 --
Mike Ford,  Electronic Information Developer,
C507, Leeds Metropolitan University, Civic Quarter Campus, 
Woodhouse Lane, LEEDS,  LS1 3HE,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 812 4730


To view the terms under which this email is distributed, please go to 
http://disclaimer.leedsmet.ac.uk/email.htm

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to