On 14 Jan 2004 at 23:16, David Blomstrom wrote:

> --- Rory McKinley <[EMAIL PROTECTED]> wrote:
> 
> > A possible option  could be something like  this 
> > 
> > {calling_template.php}
> > 
> > <?php
> >     /*State name does not have to be set statically,
> > can be set from SQL query 
> > etc*/
> 
> I think I understand what you're saying. I'm just
> getting started with PHP and haven't touched MySQL
> yet, but I can see you're setting up a database, or
> "query," and...
> 
> "> That way you can put whatever you want as the
> > statenameat the top of your pages, and 
> > the header willalways reflect it."
> 
> Then you'd put some sort of code in the head section
> of each page that would draw on the system you set up
> to translate the codes for each page.
> 
> I probably didn't work it right, but I think I get the
> general idea. I'll hang on to the code you gave me and
> play with it just as quick as I can learn more about
> this stuff.
> 
> One question, is the example you gave me a pure PHP
> function, or does it indeed involve MySQL, too?
> 
> Thanks!
> 
> __________________________________
> Do you Yahoo!?
> Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
> http://hotjobs.sweepstakes.yahoo.com/signingbonus
> 
Hi David

You do not need to use a query - if you had a database you could retrieve the state 
names from there and perhaps save on typing. The code that I gave you does not use a 
MySQL query at all, although I perhaps could have explained it better.

Basically, the situation is like this :

If you have two scripts - the main page and the header include file and you include 
the 
header script in the main page script, there are no issues of variable scope i.e. all 
variables within the included script are visible to the including script and vice 
versa. 

Therefore if you tell the header script to echo a variable and this variable is 
defined in 
the main page script instead of the header script, the header script will have access 
to 
this variable. From your part, all you have to be willing to do is set the variable on 
each 
main page.

I hope this has clarified matters somewhat and not made things worse.


Rory McKinley
Nebula Solutions
+27 82 857 2391
[EMAIL PROTECTED]
"There are 10 kinds of people in this world, 
those who understand binary and those who don't" (Unknown)

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

Reply via email to