does this work

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
OX 3
Forum Newbie
Posts: 22
Joined: Fri Jan 02, 2004 7:58 pm
Location: El Paso, TX

does this work

Post by OX 3 »

would the following code work
<?php
assign("$flare","tempestflarex@hotmail.com");
?>
<a href="
<?php
print("$flare");
?>
">
<?php
print("$flare");
?>
</a>
User avatar
AVATAr
Forum Regular
Posts: 524
Joined: Tue Jul 16, 2002 4:19 pm
Location: Uruguay -- Montevideo
Contact:

Post by AVATAr »

to make a mail link: <a href="mailto:email@web.com"> here </a>

and try your code...
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

If you implement the function `assign` it would. something like this:

Code: Select all

function assign($var_name,$var_value){
  global $$var_name;
  $$var_name=$var_value;
}
//call it as follows:
assign("flare","tempestflarex@hotmail.com");
OX 3
Forum Newbie
Posts: 22
Joined: Fri Jan 02, 2004 7:58 pm
Location: El Paso, TX

Post by OX 3 »

i am clueless
Bennettman
Forum Contributor
Posts: 130
Joined: Sat Jun 15, 2002 3:58 pm

Post by Bennettman »

To answer your question, yes it would work, apart from the lack of "mailto:" needed to make it an email link. However, this is a more effective method:

Code: Select all

<?php
$flare = "tempestflarex@hotmail.com";
print "<a href="mailto:$flare">$flare</a>";
?>
What's the purpose of the code? I don't see any point in doing it like that unless $flare could be one of a number of email addresses.
OX 3
Forum Newbie
Posts: 22
Joined: Fri Jan 02, 2004 7:58 pm
Location: El Paso, TX

Post by OX 3 »

it works thx ben
Post Reply