> function testPassVar($url) {
> $name = "TEST";
> echo "Click";
> }
>
> $url = 'asdfasdf.php3?name=$company';
> testPassVar($url);
> echo "This is a $name";
> ?>
> $url = "asdfasdf.php3?name=$company";
you need double quotes for the $company to be eval'd
also, $name is defined within a func
d the
actual address value onto the it.
Thanks eveyone,
Abe
- Original Message -
From: "Cal Evans" <[EMAIL PROTECTED]>
To: "Abe" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, January 11, 2001 10:07 PM
Subject: RE: [PHP] Function -> Sendi
ginal Message-
From: Abe [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 11, 2001 1:59 PM
To: DanO; [EMAIL PROTECTED]
Subject: Re: [PHP] Function -> Sending URL's
Hey Dan
You see in this example - the value of $company is coming from the script
and not the function - I am trying to find
d a way to do that.
>
> Thanks,
> Abe
>
> - Original Message -
> From: "DanO" <[EMAIL PROTECTED]>
> To: "Abe" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Thursday, January 11, 2001 9:41 PM
> Subject: RE: [PHP] Function -
t;=".$value;
}
$newURL = testPassVar("http://www.calevans.com?test=one","name","Cal");
Cal
http://www.calevans.com
-Original Message-----
From: Abe [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 11, 2001 3:51 PM
To: Cal Evans; [EMAIL PROTECTED]
Subject
[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, January 11, 2001 9:41 PM
Subject: RE: [PHP] Function -> Sending URL's
>
> sorry, but i didn't fully understand what you are trying to do.
>
> you can also pass 2 variables to the function:
>
> funct
variables) and letting them be
dealt with by the function.
Thanks,
Abe
- Original Message -
From: "Cal Evans" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, January 11, 2001 9:40 PM
Subject: RE: [PHP] Function -> Sending URL's
> There's a
[EMAIL PROTECTED]]
Sent: Thursday, January 11, 2001 1:35 PM
To: Abe; [EMAIL PROTECTED]
Subject: RE: [PHP] Function -> Sending URL's
you are assigning the variable within the function, then calling the
function with the variable.
this is a variable scoping issue.
try this:
Click";
}
Message -
From: "DanO" <[EMAIL PROTECTED]>
To: "Abe" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, January 11, 2001 9:34 PM
Subject: RE: [PHP] Function -> Sending URL's
>
> you are assigning the variable within the function, then c
There's a couple points here:
1: echo isn't what you want to do. You want to RETURN the value from you
function. Try this:
Click";
return "Click";
}
$url = 'asdfasdf.php3';
$newURL = testPassVar($url);
echo($newURL);
echo "This is a $name";
?>
2: in the last line, you try to echo $name. $n
you are assigning the variable within the function, then calling the
function with the variable.
this is a variable scoping issue.
try this:
Click";
}
$company = "TEST";
$url = 'asdfasdf.php3?name='.$company;
testPassVar($url);
?>
-Original Message-
From: Abe [mailto:[EMAIL PROTECT
11 matches
Mail list logo