Email link to a variable!

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

parxal
New php-forum User
New php-forum User
Posts: 40
Joined: Thu Nov 07, 2002 5:58 am

Email link to a variable!

Postby parxal » Sat Nov 09, 2002 9:00 am

<p><a href="mailto:parsxeal@hotmail.com">parsxeal@hotmail.com</a></p>

how can i make this html code in php, and transofrm it to mail to a variable?

$mail = "parsxeal@hotmail.com"

User avatar
Oleg Butuzov
Last Samuray
Last Samuray
Posts: 831
Joined: Sun Jun 02, 2002 3:09 am

Postby Oleg Butuzov » Sat Nov 09, 2002 2:08 pm

Code: Select all

<?

$content="<p><a href=\"mailto:parsxeal@hotmail.com\">parsxeal@hotmail.com</a></p>";

preg_match('/<a href="mailto:([^<]*)">/', $content, $arr);

echo $arr[1];

?>

parxal
New php-forum User
New php-forum User
Posts: 40
Joined: Thu Nov 07, 2002 5:58 am

no solved

Postby parxal » Sun Nov 10, 2002 7:46 am

the email doesn't stay like a link!
it's supose to stay like a link.

User avatar
Oleg Butuzov
Last Samuray
Last Samuray
Posts: 831
Joined: Sun Jun 02, 2002 3:09 am

Postby Oleg Butuzov » Sun Nov 10, 2002 9:12 am

I dont understand you what are you want to get
<p><a href="mailto:parsxeal@hotmail.com">parsxeal@hotmail.com</a></p>

This or this ?

parxal
New php-forum User
New php-forum User
Posts: 40
Joined: Thu Nov 07, 2002 5:58 am

:)

Postby parxal » Sun Nov 10, 2002 12:21 pm

this do the work!
thanks anyway :)

$mail="parxal@hotmail.com";
print "<p><a href='mailto:".$mail."'>".$mail."</a></p>";


Return to “PHP coding => General”

Who is online

Users browsing this forum: Bing [Bot] and 1 guest