Function Question

From: Date: Fri, 18 May 2001 20:48:48 +0000
Subject: Function Question
Groups: php.general 
Request: Send a blank email to php-general+get-53483@lists.php.net to get a copy of this message
Hi. I'm hoping you folks can help me with a function problem I have. Take a look at the following code: ?> <?php function fill_page($title) { ?> <html> <head> <title><?php echo "$title"; ?></title> <?php } ?> I have a page divided into 3 sections. A header include, the content, and a footer include. I have a function (fill_page) that lives in the header include that has it's variable defined in the content page. As you can see, the function above will fill "$title" with whatever is defined in the content page. i.e. fill_page("This is the title") What I want to do is use that $title variable *outside the function, a little further down the page. I've played around with the ampersand before the dollar sign, and using a global variable, all with no success. It seems to me that this should be simple, and I think I'm overcomplicating it. Here's what I'm trying to do: 1. Get a string of text from the individual content pages. 2. Use that string in the "Title" of the html page 3. Use the same string as the header of the content page. I'm sorry I'm being stupid about it...but I've made it harder than it probably is. Please respond to mike@thinkmango.com as I am on the digest. Thanks in advance. mto Michael O'Neal Web Producer/ Autocrosser ST 28 '89 Civic Si --------------------- M A N G O B O U L D E R --------------------- http://www.thinkmango.com e-mike@thinkmango.com p-303.442.1821 f-303.938.8507

« previous php.general (#53483) next »