View Full Version : recommend a friend
comicw
10-20-2002, 03:50 PM
Hi,
Does anyone of you have, or know where I can find, a "recommend a friend" script?
Thanks!
Nightfire
10-20-2002, 04:55 PM
Try http://hotscripts.com I have a few of them, but I don't know which CD I've put them all on :p
comicw
10-20-2002, 05:19 PM
Ok!
I've installed PHP 4.2.3 (to my hard disk, c:\php) and I've downloaded a zip file of such a script.
How do I put it on my site and how do I start customizing it?I've unzipped the file, but when I copy the code into my html, it doesn't work.
Thanks!
Nightfire
10-20-2002, 05:41 PM
Are you running your site from your PC? If you are, you'll need a server to run the php. Apache is the best one for it. PHP doesn't work in a *.HTML file, the file must be saved as *.php.
You should have a readme file in the zip file, that will tell you how to set your tell-a-friend script up
comicw
10-20-2002, 05:44 PM
No, my site is online, so I probably should be able to put it on the site. How do I do this?
Nightfire
10-20-2002, 05:51 PM
Ahh, in that case you didn't need to download php :). First, check to see if your host provides php by creating this file
<?php
phpinfo();
?>
Save this as info.php, upload to your site and go to http://www.yoursite.com/info.php
If you see a list of information with tables having purple headers, then you have php.
Then if you have php, upload your tell-a-friend script after reading the readme file included with it and editing the correct files (if you need to edit any). Then go to the file that's your tell-a-friend, http://www.yoursite.com/tell-a-friend.php
comicw
10-20-2002, 05:56 PM
So, if I'm correct, the php-page can also contain HTML elements (so I can have the same layouton the .php page as well)?
comicw
10-20-2002, 05:56 PM
So, if I'm correct, the php-page can also contain HTML elements (so I can have the same layouton the .php page as well)?
comicw
10-20-2002, 05:56 PM
So, if I'm correct, the php-page can also contain HTML elements (so I can have the same layouton the .php page as well)?
comicw
10-20-2002, 05:58 PM
Sorry for posting the same message 3 times! :rolleyes:
I have another question for you: I also want to have a poll on my index.html page.
How do I do this? Rename index.html to index.php, since you said html cannot contain php... or am I wrong again?
Nightfire
10-20-2002, 06:02 PM
Yeah, have to rename your index to index.php and to add your poll into the page, use
<?php
include("yourpollpage.php");
?>
comicw
10-20-2002, 08:02 PM
I've tried to put this in the body section of my site:
<?php_
____phpinfo();
?>
But then I get the following error:
Parse error: parse error, unexpected T_STRING in /home/visie/public_html/info.php on line 13
Does that mean that I don't have PHP?
comicw
10-20-2002, 08:08 PM
Ok! It works, it gave an error, then I uploaded it again and then it was ok!
Nightfire
10-20-2002, 08:09 PM
Even though you got an error, you do have php. The error is coz you got the ____ in the script. If you take all those lines out, it'll work. And do it in a file with nothing else on. Just a file with <?php phpinfo(); ?> in, no html or anything
comicw
10-20-2002, 08:11 PM
One more question...
How do I place the poll on the place where I want it in my index.php?
Nightfire
10-20-2002, 08:14 PM
Find the place you want to add it to in the html, then add <?php include("thepollpagename.php"); ?> into there
comicw
11-02-2002, 01:55 PM
I tried it out, with my tell a friend script since the poll-script isn't configured yet.
I edited the page and made a table where the PHP script should come.
However, the php code seems to "override" the HTML and javascript code, because it didn't show the javascript menu on the page.
Here is the code of the page:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>Tell a Friend</title>
<style type="text/css">
<!--
.menu {font-family:Verdana; font-weight: bold; text-align:right}
.menu a{text-decoration:none; color: white; font-size: 8pt}
-->
A.text:link {font-family: "Tahoma"; color: #003399; font-size: 10pt}
A.text:visited {font-family: "Tahoma"; color: #003399; font-size: 10pt}
A.text:hover {font-family: "Tahoma"; color: #0099CC; font-size: 10pt}
A.text:active {font-family: "Tahoma"; color: #003399; font-size: 10pt}
A.blad:link {font-family: "Tahoma"; color: #003399; font-size: 10pt; text-decoration: none}
A.blad:visited {font-family: "Tahoma"; color: #003399; font-size: 10pt; text-decoration: none}
A.blad:hover {font-family: "Tahoma"; color: #0099CC; font-size: 10pt; text-decoration: none}
A.blad:active {font-family: "Tahoma"; color: #003399; font-size: 10pt; text-decoration: none}
A.pf:link {font-family: "Tahoma"; color: #000000; font-size: 10pt}
A.pf:visited {font-family: "Tahoma"; color: #000000; font-size: 10pt}
A.pf:hover {font-family: "Tahoma"; color: #0099FF; font-size: 10pt}
A.pf:active {font-family: "Tahoma"; color: #000000; font-size: 10pt}
P.txt {font-family: "Tahoma"; font-size: 10pt; text-align: justify}
Body {scrollbar-3dlight-color : #D2E6FA; scrollbar-arrow-color : #D2E6FA; scrollbar-base-color : #D2E6FA;
scrollbar-darkshadow-color : #D2E6FA; scrollbar-face-color : #0033CC; scrollbar-highlight-color : #0033CC;
scrollbar-shadow-color : #D2E6FA; scrollbar-track-color : #D2E6FA}
</style>
<script language="javascript">
<!--
function movein(which,html){
which.style.background="#C0C0C0"
if (document.getElementById)
document.getElementById("boxdescription").innerHTML=html
else
boxdescription.innerHTML=html
}
function moveout(which){
which.style.background='#0033CC'
if (document.getElementById)
document.getElementById("boxdescription").innerHTML=' '
else
boxdescription.innerHTML=' '
}
//-->
</script>
</head>
<body bgcolor="#EBEBEB">
<table bgcolor="#FFFFFF" width="100%" cellspacing="0" cellpadding="0" border="1" bordercolor="#000000">
<tr>
<td>
<table width="100%" bgcolor="#FFFFFF" cellspacing="5" cellpadding="0">
<tr>
<td>
<table align="center" cellspacing="0" cellpadding="0">
<tr>
<td>
<img border="0" src="images/BVLbig.gif" align="center" width="533" height="66">
</td>
</tr>
</table>
</td>
</tr>
</table>
<table bgcolor="#FFFFFF" width="100%" cellspacing="0" cellpadding="0" height="100">
<tr>
<td>
</td>
</tr>
</table>
<table bgcolor="#FFFFFF" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="2%">
</td>
<td width="77%" valign="top" bgcolor="#D2E6FA">
<table width="98%" align="center" valign="top" bgcolor="#D2E6FA">
<tr>
<td>
<font face="Tahoma" size="2">Breng uw vrienden, kennissen of collega's op de
hoogte van ons bestaan.</font><br><br><br clear="all">
<br>
<br>
<br>
<table align="center">
<tr>
<td>
<?php include("tellfriend.php"); ?>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
<td width="2%"></td>
<td valign=top width="19%" bgcolor="#0033CC">
<table align="right" bgcolor="#0033CC">
<tr>
<td>
<table bgcolor="#0033CC" cellpadding="3" cellspacing="0" width="180">
<tr>
<td class="menu" bordercolor="#0099CC" id="choice1" ; cursor:hand" onmouseover="movein(this,'Beginpagina')" onmouseout="moveout(this)">
<a href="index.htm">Home</a></td></tr>
<td class="menu" bordercolor=""0099CC" id="choice2" ; cursor:hand" onmouseover="movein(this,'Wordt nu lid!')" onmouseout="moveout(this)">
<a href="leden.htm">Leden</a></td><tr>
<td class="menu" bordercolor="#0099CC" id="choice3" ; cursor:hand" onmouseover="movein(this,'Onze gids')" onmouseout="moveout(this)">
<a href="elliott_wave.htm">Elliott Wave</a></td><tr>
<td class="menu" bordercolor="#0099CC" id="choice4" ; cursor:hand" onmouseover="movein(this,'Een gesprekspartner')" onmouseout="moveout(this)">
<a href="persoonlijke_begeleiding.htm">Persoonlijke Begeleiding</a></td><tr>
<td class="menu" bordercolor="#0099CC" id="choice5" ; cursor:hand" onmouseover="movein(this,'Vertel het verder')" onmouseout="moveout(this)">
<a href="tell_a_friend.htm">Tell a Friend</a></td><tr>
<td class="menu" bordercolor="#0099CC" id="choice6"; cursor:hand" onmouseover="movein(this,'Plannen')" onmouseout="moveout(this)">
<a href="hedge_fund.htm">Hedge Fund</a></td><tr>
<td class="menu" bordercolor="#0099CC" id="choice5" ; cursor:hand" onmouseover="movein(this,'Resultaten!')" onmouseout="moveout(this)">
<a href="portefeuille.htm">Portefeuille</a></td><tr>
<td class="menu" bordercolor="#0099CC" id="choice6" ; cursor:hand" onmouseover="movein(this,'Het bewijs')" onmouseout="moveout(this)">
<a href="voorbeelden.htm">Voorbeelden</a></td><tr>
<td class="menu" bordercolor="#0099CC" id="choice7" ; cursor:hand" onmouseover="movein(this,'Abonnementen en adres')" onmouseout="moveout(this)">
<a href="contact.htm">Contact</a></td>
<tr>
<td bordercolor="#0033CC" bgcolor="white" height="18" align="center"><b><font id="boxdescription" face="Verdana" color="#000000" size="1"></font></b></td></tr>
</table>
<table align="center" bgcolor="#0033CC">
<tr>
<td>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table bgcolor="#FFFFFF" width="100%" cellspacing="0" cellpadding="0" height="20">
<tr>
<td>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
comicw
11-02-2002, 01:56 PM
So, somewhere in the middle I inserted the php script, but the layout doesn't stay the same. How can this be fixed?
PS: I did change the .htm page into .php
Nightfire
11-02-2002, 02:15 PM
Not surprised it's now showing right. Your HTML is a mess. Where's the </tr>'s in your menu?
</td>
</tr>
<tr>
??
comicw
11-02-2002, 03:23 PM
Ok, I'll add those <tr>'s ... but I don't see what else is incomplete...
comicw
11-02-2002, 03:23 PM
PS: Without the php in it (just a .htm file) everything is shown correctly though...
comicw
11-09-2002, 09:11 AM
Hi,
I've cleaned up the html code of my page, renamed it to .php , but the php script still overrules the layout (everything is shown correctly except the right-side javascript menu bar). In the 2 posts below, I've posted the code for the page and the actual php script respectively.
comicw
11-09-2002, 09:11 AM
The PHP script:
<?php
// number of friend fields to put on the page
$tellnumber = "5";
// subject of email
$subject = "Beleggingsvisie: uitnodiging";
// Message sent in the email
$message = "Op www.beleggingsvisie.be vindt u een aparte kijk op beleggen, die bewezen heeft 6 jaar op rij succesvol te kunnen zijn. Neem dus beslist eens een kijkje";
// url to redirect user to once they click submit
$thankyouurl = "http://www.beleggingsvisie.be";
/////
if($submitform) {
$num=0;
while($num < $tellnumber) {
$num++;
$temail = "femail"."$num";
$tname = "fname"."$num";
if($$tname OR $$temail) {
if(!$$tname) {
$error .= "Missing Friends Name, Friend $num<BR>";
}
if(!$$temail) {
$error .= "Missing Friends Email, Friend $num<BR>";
}
}
if($$temail) {
if(!ereg("@",$$temail)) { $error .= "Invalid Email Address, Friend $num<BR>"; }
if(!ereg("\.",$$temail)) { $error .= "Invalid Email Address, Friend $num<BR>"; }
}
}
if(!$tname) {
$error .= "Missing your name<BR>";
}
if(!ereg("@",$email)) { $error .= "Invalid Email Address<BR>"; }
if(!ereg("\.",$email)) { $error .= "Invalid Email Address<BR>"; }
if($error) {
?>
<P><CENTER><TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0">
<TR>
<TD WIDTH="50%" BGCOLOR="#0033CC">
<TABLE WIDTH="400" BORDER="0" CELLSPACING="1" CELLPADDING="2">
<TR>
<TD WIDTH="26%" BGCOLOR="#0033CC">
<B><FONT COLOR="#ffffff" SIZE="-1" FACE="Tahoma">Error</FONT></B></TD>
</TR>
<TR>
<TD WIDTH="26%" BGCOLOR="#ffffff">
<FONT COLOR="#000000" SIZE="-1" FACE="Tahoma"><?php echo $error; ?></FONT></TD>
</TR>
</TABLE></TD>
</TR>
</TABLE></CENTER>
</BODY></HTML>
<?php
exit();
}
$num=0;
while($num < $tellnumber) {
$num++;
$temail = "femail"."$num";
$tname = "fname"."$num";
$then = $$tname;
if($$temail AND $$tname) {
mail($$temail,"$subject","
$then,
$message
Met vriendelijke groeten,
$name
","From: $name <$email>");
$youremail = "visie@beleggingsvisie.be";
$yoursubject = "Tell a friend werd gebruikt door: $name";
$yourmessage = "Tell a friend werd gebruikt door: $name
Friends email: $temail
Zenders email: $email
Zenders name: $name
Verzonden boodschap: $message";
$reply = "Van: $youremail";
mail($youremail,$yoursubject,$yourmessage,$reply);
}
}
exit();
} else {
$num=0;
while($num < $tellnumber) {
$num++;
$theboxes .= " <TR>
<TD WIDTH=\"49%\" BGCOLOR=\"#0033CC\">
<P><CENTER><B><FONT COLOR=\"#FFFFFF\" SIZE=\"-1\" FACE=\"Verdana\">$num</FONT></B></CENTER></TD>
<TD WIDTH=\"26%\" BGCOLOR=\"#0033CC\">
<P><CENTER><INPUT NAME=\"fname$num\" TYPE=\"text\" SIZE=\"25\"></CENTER></TD>
<TD WIDTH=\"25%\" BGCOLOR=\"#0033CC\">
<INPUT NAME=\"femail$num\" TYPE=\"text\" SIZE=\"25\">
</TD>
</TR>";
}
?>
<P><CENTER><FONT FACE="Verdana" color="#0033CC" size="2"><B>Tell a friend</B></FONT></CENTER></P>
<FORM ACTION="tellfriend.php" METHOD="POST"><P><CENTER><TABLE BORDER="0" CELLSPACING="0"
CELLPADDING="0">
<TR>
<TD width= "60%" BGCOLOR="#0033CC">
<TABLE WIDTH="100%" BORDER="0" CELLSPACING="1" CELLPADDING="2">
<TR>
<TD WIDTH="25%" BGCOLOR="#0033CC">
<P><CENTER><B><FONT COLOR="#FFFFFF" SIZE="-1" FACE="Tahoma">Uw naam</FONT></B></CENTER></TD>
<TD WIDTH="25%">
<P><CENTER><B><FONT COLOR="#FFFFFF" SIZE="-1" FACE="Tahoma">Uw e-mail</FONT></B></CENTER></TD>
</TR>
<TR>
<TD WIDTH="25%" BGCOLOR="#0033CC">
<P><CENTER><INPUT NAME="name" TYPE="text" SIZE="25"></CENTER></TD>
<TD WIDTH="25%" BGCOLOR="#0033CC">
<INPUT NAME="email" TYPE="text" SIZE="25">
</TD>
</TR>
</TABLE></TD>
</TR>
</TABLE></CENTER></P><P><CENTER><TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0">
<TR>
<TD width="60%" BGCOLOR="#0033CC">
<TABLE WIDTH="100%" BORDER="0" CELLSPACING="1" CELLPADDING="2">
<TR>
<TD WIDTH="50%" BGCOLOR="#0033CC"></TD>
<TD WIDTH="25%" BGCOLOR="#0033CC">
<P><CENTER><B><FONT COLOR="#FFFFFF" SIZE="-1" FACE="Tahoma">Uw vriend</FONT></B></CENTER></TD>
<TD WIDTH="25%">
<P><CENTER><B><FONT COLOR="#FFFFFF" SIZE="-1" FACE="Tahoma">Zijn e-mail</FONT></B></CENTER></TD>
</TR><?php echo $theboxes; ?></TABLE></TD>
</TR>
</TABLE></CENTER></P>
<P><CENTER><INPUT NAME="submitform" TYPE="submit" VALUE="Verzenden"></CENTER></FORM>
</BODY></HTML>
<?php
exit();
}
?>
comicw
11-09-2002, 09:13 AM
The HTML code for the page on which the php script should appear.
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>Tell a Friend</title>
<style type="text/css">
<!--
.menu {font-family:Verdana; font-weight: bold; text-align:right}
.menu a{text-decoration:none; color: white; font-size: 8pt}
-->
A.text:link {font-family: "Tahoma"; color: #003399; font-size: 10pt}
A.text:visited {font-family: "Tahoma"; color: #003399; font-size: 10pt}
A.text:hover {font-family: "Tahoma"; color: #0099CC; font-size: 10pt}
A.text:active {font-family: "Tahoma"; color: #003399; font-size: 10pt}
A.blad:link {font-family: "Tahoma"; color: #003399; font-size: 10pt; text-decoration: none}
A.blad:visited {font-family: "Tahoma"; color: #003399; font-size: 10pt; text-decoration: none}
A.blad:hover {font-family: "Tahoma"; color: #0099CC; font-size: 10pt; text-decoration: none}
A.blad:active {font-family: "Tahoma"; color: #003399; font-size: 10pt; text-decoration: none}
A.pf:link {font-family: "Tahoma"; color: #000000; font-size: 10pt}
A.pf:visited {font-family: "Tahoma"; color: #000000; font-size: 10pt}
A.pf:hover {font-family: "Tahoma"; color: #0099FF; font-size: 10pt}
A.pf:active {font-family: "Tahoma"; color: #000000; font-size: 10pt}
P.txt {font-family: "Tahoma"; font-size: 10pt; text-align: justify}
Body {scrollbar-3dlight-color : #D2E6FA; scrollbar-arrow-color : #D2E6FA; scrollbar-base-color : #D2E6FA;
scrollbar-darkshadow-color : #D2E6FA; scrollbar-face-color : #0033CC; scrollbar-highlight-color : #0033CC;
scrollbar-shadow-color : #D2E6FA; scrollbar-track-color : #D2E6FA}
</style>
<script language="javascript">
<!--
function movein(which,html){
which.style.background="#C0C0C0"
if (document.getElementById)
document.getElementById("boxdescription").innerHTML=html
else
boxdescription.innerHTML=html
}
function moveout(which){
which.style.background='#0033CC'
if (document.getElementById)
document.getElementById("boxdescription").innerHTML=' '
else
boxdescription.innerHTML=' '
}
//-->
</script>
</head>
<body bgcolor="#EBEBEB">
<table bgcolor="#FFFFFF" width="100%" cellspacing="0" cellpadding="0" border="1" bordercolor="#000000">
<tr>
<td>
<table width="100%" bgcolor="#FFFFFF" cellspacing="5" cellpadding="0">
<tr>
<td>
<table align="center" cellspacing="0" cellpadding="0">
<tr>
<td>
<img border="0" src="images/BVLbig.gif" align="center" width="533" height="66">
</td>
</tr>
</table>
</td>
</tr>
</table>
<table bgcolor="#FFFFFF" width="100%" cellspacing="0" cellpadding="0" height="100">
<tr>
<td>
</td>
</tr>
</table>
<table bgcolor="#FFFFFF" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="2%">
</td>
<td width="77%" valign="top" bgcolor="#D2E6FA">
<table width="98%" align="center" valign="top" bgcolor="#D2E6FA">
<tr>
<td>
<font face="Tahoma" size="2">Breng uw vrienden, kennissen of collega's op de
hoogte van ons bestaan.</font><br><br><br clear="all">
<br>
<br>
<br>
<table align="center">
<tr>
<td>
<?php include("tellfriend1.php"); ?>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
<td width="2%"></td>
<td valign=top width="19%" bgcolor="#0033CC">
<table align="right" bgcolor="#0033CC">
<tr>
<td>
<table bgcolor="#0033CC" cellpadding="3" cellspacing="0" width="180">
<tr>
<td class="menu" bordercolor="#0099CC" id="choice1" ; cursor:hand" onmouseover="movein(this,'Beginpagina')" onmouseout="moveout(this)">
<a href="index.htm">Home</a></td></tr>
<td class="menu" bordercolor=""0099CC" id="choice2" ; cursor:hand" onmouseover="movein(this,'Wordt nu lid!')" onmouseout="moveout(this)">
<a href="leden.htm">Leden</a></td></tr>
<tr>
<td class="menu" bordercolor="#0099CC" id="choice3" ; cursor:hand" onmouseover="movein(this,'Onze gids')" onmouseout="moveout(this)">
<a href="elliott_wave.htm">Elliott Wave</a></td></tr>
<tr>
<td class="menu" bordercolor="#0099CC" id="choice4" ; cursor:hand" onmouseover="movein(this,'Een gesprekspartner')" onmouseout="moveout(this)">
<a href="persoonlijke_begeleiding.htm">Persoonlijke Begeleiding</a></td></tr>
<tr>
<td class="menu" bordercolor="#0099CC" id="choice5" ; cursor:hand" onmouseover="movein(this,'Vertel het verder')" onmouseout="moveout(this)">
<a href="tell_a_friend.htm">Tell a Friend</a></td></tr>
<tr>
<td class="menu" bordercolor="#0099CC" id="choice6"; cursor:hand" onmouseover="movein(this,'Plannen')" onmouseout="moveout(this)">
<a href="hedge_fund.htm">Hedge Fund</a></td></tr>
<tr>
<td class="menu" bordercolor="#0099CC" id="choice5" ; cursor:hand" onmouseover="movein(this,'Resultaten!')" onmouseout="moveout(this)">
<a href="portefeuille.htm">Portefeuille</a></td></tr>
<tr>
<td class="menu" bordercolor="#0099CC" id="choice6" ; cursor:hand" onmouseover="movein(this,'Het bewijs')" onmouseout="moveout(this)">
<a href="voorbeelden.htm">Voorbeelden</a></td></tr>
<tr>
<td class="menu" bordercolor="#0099CC" id="choice7" ; cursor:hand" onmouseover="movein(this,'Abonnementen en adres')" onmouseout="moveout(this)">
<a href="contact.htm">Contact</a></td></tr>
<tr>
<td bordercolor="#0033CC" bgcolor="white" height="18" align="center"><b><font id="boxdescription" face="Verdana" color="#000000" size="1"></font></b></td></tr>
</table>
<table align="center" bgcolor="#0033CC">
<tr>
<td>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table bgcolor="#FFFFFF" width="100%" cellspacing="0" cellpadding="0" height="20">
<tr>
<td>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
missing-score
02-12-2003, 10:18 PM
If you put the PHP in a certain place, (eg. between a <td> and </td>) the display that it returns will be in that table cell.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.