Announcement

Collapse
No announcement yet.

php functions and variables

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • php functions and variables

    I'm fairly new to php, so I'm not to sure of what I'm doing. Any help would be great.

    I have two functions called my_siteTop and my_siteBottom, which draw the header and footer for every one of my pages on my site. How do I create a global variable that will carry between the two functions. All of my variables I have now are only good within the specific function.

    Here's what it looks like now:

    <?
    function my_siteTop (
    $page= "",
    $title= "",
    $description= "",
    $keywords= "",
    $author= "",
    $baseref= "http://localhost/",
    $path= "/www/webdirectorylocation"
    )
    {
    include("$path/include/site_top.php3");
    }

    function my_siteBottom (
    $path= "/www/webdirectorylocation"
    )
    {
    include("$path/include/site_bottom.php3");
    }
    ?>

  • #2
    global $variable;
    Aaron
    aewebdesign

    Comment


    • #3
      Thanks ... I got everything working just right now.

      Comment

      widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
      Working...
      X