> <?
> function testPassVar($url) {
> $name = "TEST";
> echo "<a href=\"$url\">Click</a>";
> }
> 
> $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 function, which means you don't have access
to it from the "outside world"

can you give a little more detail?

-alex



--
Alex Black, Head Monkey
[EMAIL PROTECTED]

The Turing Studio, Inc.
http://www.turingstudio.com

vox+510.666.0074
fax+510.666.0093

Saul Zaentz Film Center
2600 Tenth St Suite 433
Berkeley, CA 94710-2522




> From: [EMAIL PROTECTED] ("Abe")
> Newsgroups: php.general
> Date: 11 Jan 2001 13:25:43 -0800
> Subject: [PHP] Function -> Sending URL's
> 
> Hey there,
> this is a strange one - I want to send a URL to a function that includes
> varibles.  Those variables should be taken from within the function - as in
> the example below the link I want is:
> 
> asdfasdf.php3?name=TEST  , but that is not what I get as you can see.
> 
> Does anybody know a way around this - The example is simpler than what I am
> actually doing and the value of $company must come from the variable.
> 
> Thanks,
> Abe
> 
> 
> 
> <?
> function testPassVar($url) {
> $name = "TEST";
> echo "<a href=\"$url\">Click</a>";
> }
> 
> $url = 'asdfasdf.php3?name=$company';
> testPassVar($url);
> echo "This is a $name";
> ?>
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to