Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Feb 2003
    Posts
    345
    Thanks
    0
    Thanked 0 Times in 0 Posts

    problem with a function, includes and vars.

    The page is cutted in some includes and in one include, there is a function.
    In the header, one variable is set:
    PHP Code:
    $var $_GET['l'
    then in the page there is a include:
    PHP Code:
    include('ads.php'):
    function 
    location(); 
    the include looks like:
    PHP Code:
    function location() {
      if (
    $var == location1) {
        echo (
    "bla bla bla");
      } else if (
    $var == location2) {
        echo (
    "ble ble ble");
      } 
    In that include there are several functions and what I want is to use the $var in all the functions, but for that I have to write it in all the functions like this:
    PHP Code:
    function location() {
    $var $_GET['l'];
    blablabla... } 
    So the question is... How can I pass variables to a function when they are already set??
    Last edited by maltrecho; 09-14-2003 at 06:00 PM.

  • #2
    Regular Coder
    Join Date
    Feb 2003
    Posts
    345
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Forget it, it's done. Delete it if you want. Sorry.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •