Announcement

Collapse
No announcement yet.

php functions and variables

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

  • mferrell
    replied
    Thanks ... I got everything working just right now.

    Leave a comment:


  • Aaron
    replied
    global $variable;

    Leave a comment:


  • mferrell
    started a topic php functions and variables

    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");
    }
    ?>
widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
Working...
X