Log in

View Full Version : i need tell friend script.



designsecrets
07-18-2008, 11:38 AM
dear members,
i hope you answer my question. i have tried many script or tell a friend but i need it be on a hyperlink or a button to be open on new window which has fields for sender email and name + recipient email. it should be sent without open outlook.???how???

please i need our answer ASAP..

thank you..

codeexploiter
07-18-2008, 12:09 PM
http://www.asp101.com/Samples/tell_a_friend_aspx.asp

designsecrets
07-18-2008, 12:21 PM
thanx alot for your reply but i think i use javascript it will be easier.. do you have a script for tell friend in javascript???

jscheuer1
07-18-2008, 03:07 PM
Javascript cannot really do this, it can but it will not work for anyone without a mail client (folks who use gmail or yahoo mail, hotmail, etc.), and it will not work for folks with javascript disabled.

Now, what codex linked you to would require server support for asp.Net - many, but not all have this, does your host?

If not, there are sure to be equivalent scripts for PHP, plain asp (not the .NET variety), jsp, and for formail, and probably for other server side languages. Google will likely help you find one of those if you need them.

Alternatively, you could just ask your host what they recommend. It is quite possible that they already have a widget for 'Tell a Friend' all setup and ready to go. At the very least, they should know what server side languages they would support for this.

designsecrets
07-19-2008, 01:51 PM
thanks alot for your replies, i tried the code http://www.asp101.com/Samples/tell_a_friend_aspx.asp

but it wrote that the messgae sent but nothing recieved???!!!!WHY

still need help, please if anywone have tried a tell friend script,,tell me what to do????:confused:

jscheuer1
07-19-2008, 05:29 PM
Does your host support asp.Net?

designsecrets
07-19-2008, 10:04 PM
yes my server support asp but i am testing the code on my localhost does this make differrent???

the code i used is attached please test it and tell me if it really send email to friend.

thanks alot for your concern..waiting for reply...

techietim
07-19-2008, 10:31 PM
It probably would not work on your localhost if you do not have an SMTP server setup on it (excuse my ignorance of ASP, if I made no sense).

jscheuer1
07-20-2008, 01:12 AM
It probably would not work on your localhost if you do not have an SMTP server setup on it (excuse my ignorance of ASP, if I made no sense).

True. And the localhost must support asp.NET as well. None of that matters though if the live host doesn't support asp.NET. So I ask designsecrets again:


Does your [live] host support asp.Net?

designsecrets,

Please just use the default font size in your posts, we can all increase it on our end if we have any trouble reading it. If you are having trouble reading the font, increase its size in your browser's view menu.

designsecrets
07-20-2008, 05:00 AM
many thanks for all of you..


It probably would not work on your localhost if you do not have an SMTP server setup on it (excuse my ignorance of ASP, if I made no sense).

what do you mean by SMTP server setup my outlook is setting is ok but i don/t want to use it
in the tell friend message i want to be from any email to any...

i am sure my localhost support asp.net i work on my sites under vb.net and it works proberly.

i really apreaciate your support...
sorry about increasing font...

thetestingsite
07-20-2008, 06:51 AM
Outlook is an email client, not an SMTP server. Search google for an SMTP server. I'm not really familiar with vb.net or asp, but you need to make sure that your (live) host has asp.NET installed before you can use the script posted. If you have PHP or any other server side language installed on the live server, you could search hotscripts.com for your specific script.

Hope this helps.

designsecrets
07-20-2008, 02:36 PM
thanks alot for your valuable information , i need to search about it .
thank you again

chechu
07-23-2008, 08:01 AM
This is one I have:

<head>

<script type="text/javascript">
<!--
function reset() {
document.tellafriend.name.value="";
document.tellafriend.email.value="";
document.tellafriend.friendmail1.value="";
document.tellafriend.friendmail2.value="";
document.tellafriend.friendmail3.value="";
}
function validate(form) {
if (form.name.value.length==0) {
alert("vul je naam in, aub");
return false;
}
if (form.email.value.length==0) {
alert("vul je email adres in, aub");
return false;
}
if (form.friendmail1.value.length==0) {
alert("vul je vriends email adres in, aub");
return false;
}
return true;
}
//-->
</script>

body tag:

<body onload="reset()">

form in html:

<form name="tellafriend" action="tellafriend.php" method="post" onsubmit="return validate(this);">

<table border="0" cellpadding="10" cellspacing="0">
<tr><td>
&#42 je naam:
</td><td>
<input size="30" class="input" name="name" style="border:1px solid #666666; width:250px">
</td></tr>
<tr><td>
&#42 je email:
</td><td>
<input size="30" class="input" name="email" onFocus="clearDefault(this)" style="border:1px solid #666666; width:250px">
</td></tr>
<tr><td>
&#42 email vriend 1
</td><td>
<input size="30" class="input" name="friendmail1" onFocus="clearDefault(this)" style="border:1px solid #666666; width:250px">
</td></tr>
<tr><td>
email vriend 2
</td><td>
<input size="30" class="input" name="friendmail2" onFocus="clearDefault(this)" style="border:1px solid #666666; width:250px">
</td></tr>
<tr><td>
email vriend 3
</td><td>
<input size="30" class="input" name="friendmail3" onFocus="clearDefault(this)" style="border:1px solid #666666; width:190px">
&nbsp;
<INPUT TYPE="submit" class="input" NAME="submit" VALUE="zend" onclick="validate();" style="border: 1px solid #666666; background-color:white; height:17px; width:48px;">
</td></tr></table>

</form>

tellafriend.php

<?php

if(count($_POST)) {

foreach(array('friendmail1','friendmail2','friendmail3','email','name') as $key) $_POST[$key] = strip_tags($_POST[$key]);
if(!is_secure($_POST)) { die("Asta la vista Hacker");}

$emailto = "bert@ikke.be";

$esubject = "tell a friend is gebruikt";

$emailtext = "
$_POST[name] heeft de tell-a-friend form gebruikt. Zijn email adres is $_POST[email]

De vrienden zijn:

$_POST[friendmail1]
$_POST[friendmail2]
$_POST[friendmail3]

";

@mail("$emailto", $esubject, $emailtext, "From: $_POST[email]");

$thankyoupage = "index.html";

$tsubject = "$_POST[name] raadt je hetbestevoordeel.be aan";

$ttext = "
Hey,

$_POST[name] ( $_POST[email] ) raadt je deze site aan:
http://www.hetbestevoordeel.be
Zeker bezoeken !

";

@mail("$_POST[friendmail1],$_POST[friendmail2],$_POST[friendmail3]", $tsubject, $ttext, "FROM: $_POST[email]");

header("Location: $thankyoupage");
exit;

}

function is_secure($ar) {
$reg = "/(Content-Type|Bcc|MIME-Version|Content-Transfer-Encoding)/i";
if(!is_array($ar)) { return preg_match($reg,$ar);}
$incoming = array_values_recursive($ar);
foreach($incoming as $k=>$v) if(preg_match($reg,$v)) return false;
return true;
}

function array_values_recursive($array) {
$arrayValues = array();
foreach ($array as $key=>$value) {
if (is_scalar($value) || is_resource($value)) {
$arrayValues[] = $value;
$arrayValues[] = $key;
}
elseif (is_array($value)) {
$arrayValues[] = $key;
$arrayValues = array_merge($arrayValues, array_values_recursive($value));
}
}
return $arrayValues;
}
?>