PDA

View Full Version : Looking for script: 'Recommend this Site'



gogogadget
01-11-2007, 09:17 PM
I am looking for a script that allows my visitors to recommend my website. The scripts I have come across are fairly involved and I just want a really simple click and send procedure...nothing fancy.

Thanks for the help!

Twey
01-11-2007, 09:38 PM
I'm afraid that this sort of script is invariably going to involve server-side scripting, though it needn't be too involved. What server-side languages do you have enabled on your server?

djr33
01-12-2007, 02:51 PM
What are you asking? A comment? A recommend to a friend thing? A way to copy a link to your site? What?

gogogadget
01-13-2007, 12:08 AM
A recommend to a friend thing?

gogogadget
01-13-2007, 12:08 AM
I am trying to understand PFP to make this work...

thetestingsite
01-13-2007, 12:19 AM
I am trying to understand PFP to make this work...

Do you mean PHP? Well, if you do, PHP is pretty simple to learn, especially if you want to make your own "Recommend This Site" script. I made a couple a while back and I believe I posted them on here, but I can't seem to find them. Basically, all you need to accomplish this is use a HTML form with a few fields. After that, you need the PHP script to process the data submitted and send a message to either just the one person, or mulitple persons at one time by email. Let me know if you need any further help on it.

gogogadget
01-13-2007, 12:23 AM
Yes, PHP (oops).

Here is the code I am using as a reference:

<head>

<script>

var ns6=document.getElementById&&!document.all

function restrictinput(which, maxlength, e){
if (document.all&&which.value.length>=maxlength){
return false
}
else if (!document.all&&which.value.length>=maxlength){
var pressedkey=/[a-zA-Z0-9\.\,\/]/ //detect alphanumeric keys
if (pressedkey.test(String.fromCharCode(e.which)))
return false
}
}

function checklength(what){
if (what.message.value.length>200){
alert ("Please restrict personal message to <200 characters")
what.message.focus()
return false
}
}

function alertdefault(){
alert('This is an email from your friend recommending to you our site http://www.dynamicdrive.com Dynamic Drive is the #1 DHTML site online, featuring 100s of free, original DHTML scripts to enhance your site. Visit us at http://www.dynamicdrive.com')
}

</script>

</head>


<body>

<body topMargin=3 marginheight=3>

<form action="sitesuggest.php" method="post" onsubmit="return checklength(this)">
<table border="0" width="100&#37;" cellspacing="0" cellpadding="2" bgcolor="#000080" height="28">
<tr>
<td width="100%"><b><font size="2" face="Verdana" color="#FFFFFF">&nbsp;Recommend
DynamicDrive.com to a friend</font></b></td>
</tr>
</table>
<p><font face="Verdana" size="2">Please use the below form to recommend Dynamic
Drive to your peers and co-workers! You can recommend
up to 5 friends at once:</font>
<b><br><font color="#FFFFFF"><small>.</small></font></b></p>

<div align="center">
<center>
<div align="center">
<table border="0" width="450" cellspacing="0" cellpadding="0">
<tr>
<td width="100%">
<table border="0" width="450" cellspacing="0" cellpadding="3">
<tr>
<td width="50%">
<p align="center"><b>Your name</b></td>
<td width="50%">
<p align="center"><b>Your E-mail address</b></td>
</tr>
<tr>
<td width="50%">
<p align="center"><input type="text" name="userName" size="20"></td>
<td width="50%">
<p align="center"><input type="text" name="userEmail" size="25"></td>
</tr>
<tr>
<td width="50%"><font color="#FFFFFF" size="1">.</font></td>
<td width="50%"></td>
</tr>
<tr>
<td width="50%">

<p align="center"><b>Friend's name</b></td>
<td width="50%">
<p align="center"><b>Friend's E-mail address</b></td>
</tr>
<tr>
<td width="50%">
<p align="center"><input type="text" name="friendName[]" size="20"></td>
<td width="50%">
<p align="center"><input type="text" name="friendEmail[]" size="25"></td>
</tr>
<tr>
<td width="50%">
<p align="center"><input type="text" name="friendName[]" size="20"></td>
<td width="50%">
<p align="center"><input type="text" name="friendEmail[]" size="25"></td>
</tr>
<tr>
<td width="50%">
<p align="center"><input type="text" name="friendName[]" size="20"></td>
<td width="50%">
<p align="center"><input type="text" name="friendEmail[]" size="25"></td>
</tr>
<tr>
<td width="50%">
<p align="center"><input type="text" name="friendName[]" size="20"></td>
<td width="50%">
<p align="center"><input type="text" name="friendEmail[]" size="25"></td>
</tr>
<tr>
<td width="50%">
<p align="center"><input type="text" name="friendName[]" size="20"></td>
<td width="50%">
<p align="center"><input type="text" name="friendEmail[]" size="25"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="100%" align="center">
<p align="center"><br>
<b><a href="#" onClick="alertdefault();return false">View Default message added</a></b><br>
<br>
<b>Add your personal message (optional):</b><br>
<textarea rows="4" name="message" cols="32" wrap="virtual" onkeypress="return restrictinput(this, 200, event)"></textarea></p>
<p align="center"><input type="submit" value="Recommend Dynamic Drive" name="B1">
</td>
</tr>
</table>
</div>
</center>
</div>
</form>

<p align="center"><font size="1" face="Arial">CopyRight &#169; 1998-2002 <a href="http://www.dynamicdrive.com">Dynamic
Drive</a>.</font>

</p>

</body>

What I don't understand is the sitesuggest.php part and how to write that to process the data. I understand it is needed, but I just don't know how to proceed.

Thanks again!!!

thetestingsite
01-13-2007, 12:29 AM
Give me a little while, see if I can set something up, then I'll post it here (if no one else has done so before.)

gogogadget
01-13-2007, 12:39 AM
Thanks again...I REALLY appreciate the guidance!!!

mburt
01-13-2007, 02:37 AM
Do you mean for the current user to click a button that sends an email to this person they want to suggest your site to?

gogogadget
01-13-2007, 07:01 AM
Yes...

A link that says 'Recommend this Site', or 'Share this Website' and allows a visitor the ability to enter their information and up to 5 friends.

I have the code to do this, no problem...

What I fail to understand is the PHP tie in and what code accompany's the PHP page to make this all work.