[advanced search]
 

Go Back   NamePros.com > Discussion > Web Design & Development > Programming

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.


Closed Thread
 
LinkBack Thread Tools
Old 10-18-2006, 05:05 AM   #1 (permalink)
First Time Poster !
 
gazzip's Avatar
 
Join Date: Apr 2005
Location: Mc Scotland
Posts: 6,416
226.12 NP$ (Donate)

gazzip has a brilliant futuregazzip has a brilliant futuregazzip has a brilliant futuregazzip has a brilliant futuregazzip has a brilliant futuregazzip has a brilliant futuregazzip has a brilliant futuregazzip has a brilliant futuregazzip has a brilliant futuregazzip has a brilliant futuregazzip has a brilliant future


Email link to a friend code ??

Hi All Anyone know the html code for emailing a link to a friend - one where you can also put in the email subject and a couple of lines about what the link is about ?

Appreciate any help you can provide Thanks



.
gazzip is offline  
Old 10-18-2006, 06:46 AM   #2 (permalink)
NamePros Member
 
sote's Avatar
 
Join Date: Jul 2006
Posts: 70
13.20 NP$ (Donate)

sote will become famous soon enoughsote will become famous soon enough


With plain HTML the most you can do is:
<a href="mailto:yourid@emailprovider.com">Tell a Friend</a>
which will bring up the users default mail program eg: Outlook.
I suggest not using this method as most people don't use these email clients.

On the otherhand, you could create a HTML 'form' which is processed by PHP which is probably the best way to do this.
sote is offline  
Old 10-18-2006, 09:50 AM   #3 (permalink)
An American Soldier
 
-Ray-'s Avatar
 
Join Date: Jun 2005
Location: Pennsylvania
Posts: 1,630
2.53 NP$ (Donate)

-Ray- is a splendid one to behold-Ray- is a splendid one to behold-Ray- is a splendid one to behold-Ray- is a splendid one to behold-Ray- is a splendid one to behold-Ray- is a splendid one to behold-Ray- is a splendid one to behold-Ray- is a splendid one to behold


I think this is what he wanted... Put all that in one php page in the following order.. The following code is a form that posts to it self to send mail..


PHP Code:

<?php
if (!isset($_POST["send"])){
   
// no post data -> display form
?>
HTML Code:
 <form method="POST" action="<?=$_SERVER['PHP_SELF'];?>">
   To: <input type="text" name="to">
   From: <input type="text" name="sender">
   Subject : <input type="text" name="subject">
   Message : 
   <textarea name="message" rows="10" cols="60" lines="20"></textarea>
   <input type="submit" name="send" value="Send">
   </form> 
PHP Code:
<?php
}else{

   
// found post data
   
$from=$_POST['sender'];
  
$to=$_POST['to'];

   
// send mail :

   
if (mail($to,$_POST['subject'],$_POST['message'],"From: $from\n")){
     
// display confirmation message if mail sent successfully
     
echo "Your mail sent to $to.";
}else{
   
// sending failed
    
echo "Your mail could not be sent.";
   }
}
?>
__________________
Completely Free cPanel Hosting
-- Deployed to Afghanistan --
"There is no such thing as rich over-night unless you owned Google stock in 2006"
-Ray- is offline  
Old 10-19-2006, 07:57 AM   #4 (permalink)
First Time Poster !
 
gazzip's Avatar
 
Join Date: Apr 2005
Location: Mc Scotland
Posts: 6,416
226.12 NP$ (Donate)

gazzip has a brilliant futuregazzip has a brilliant futuregazzip has a brilliant futuregazzip has a brilliant futuregazzip has a brilliant futuregazzip has a brilliant futuregazzip has a brilliant futuregazzip has a brilliant futuregazzip has a brilliant futuregazzip has a brilliant futuregazzip has a brilliant future


Thanks Guys - That php stuff looks a little confusing to me though..well, alot

Maybe it is a javascript code I need ?? I have used it once years ago and I think it was just a case of popping a piece of code in the header as far as I remember.

Anyone know if there is such a javascript code for this ?



.
gazzip is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Site Sponsors
Advertise your business at NamePros

All times are GMT -7. The time now is 01:21 AM.


Powered by: vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
Template-Modifications by TMS
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85