cancel
Showing results for 
Search instead for 
Did you mean: 

Recommend a friend script

N/A

Recommend a friend script

Hello

I'm a total novice with all this stuff but I am wanting to have a 'recommend this page to a friend' php script on a website I am hoping to do. I don't really have a clue what to do with it.

The file is called index.php Where do I have to upload it to? I have my cgi space and web space activated. I uploaded it to the cgi space but don't really have a clue what else to do. How do I get it working.

Simple answers would be most aprreciated! Cheesy

Thanks

Andy

p.s. this is everything that appears in index.php file


<?php

## Start Config ##
$sitename = "Saltshaker";
$siteurl = "http://www.saltshaker.co.uk";
$adminemail = "blah@blah.com";
$emailsubject = "Which email is this going on";

$keywords = ""; // site keywords
$des = ""; // description of site

$textcolor = "000000";
$color1 = "#EAE3FD";
$color2 = "#DBE7FD";
$color3 = "#FEF3ED";

$footer = "header code";
$header = "footer code";

## Put your message here between "" marks ##

$msg = "put your email message here my message";

######### END CONFIG ####################

if ($submit){


// if email #1 and email #2 are empty, display error //
if ($email1 == "" || $email2 == "") {
echo "<font size=3 face=Arial><B>ERROR!!</b></font><font size='2' face='arial'>Either <b>yourname</b>, <b>friends name</b>, <b>your email</b> or your <b>friends email</b> was left out, please go back and fill in the entire form. Thank you!</font>";exit;}

// Start Message to friend

$message = "This message is from your friend : $email1
----------
$msg
";

mail("$email2","$emailsubject", $message, "From:$sitename <$adminemail>");
mail("$email3","$emailsubject", $message, "From:$sitename <$adminemail>");
mail("$email4","$emailsubject", $message, "From:$sitename <$adminemail>");
mail("$email5","$emailsubject", $message, "From:$sitename <$adminemail>");


?>
<!-- Start Thank you -->
<body bgcolor="<?=$color3?>" text="<?=$textcolor?>">
<TABLE WIDTH="37%" ALIGN="CENTER">
<TR>

<TD WIDTH="45%"><DIV ALIGN="CENTER"><FONT SIZE="2" FACE="Arial"><B>Your Email:</B></FONT></DIV></TD>
<TD WIDTH="55%"><font face="Arial" size="2">
<?=$email1?>
</font></TD>
</TR>
<TR>
<TD WIDTH="45%"><DIV ALIGN="CENTER"><FONT SIZE="2" FACE="Arial"><B>Friends Email:</B></FONT></DIV></TD>
<TD WIDTH="55%"><FONT FACE="Arial" SIZE="2"><?=$email2?></FONT></TD>
</TR>
<TR>
<TD WIDTH="45%"><DIV ALIGN="CENTER"><FONT SIZE="2" FACE="Arial"><B>Friends Email:</B></FONT></DIV></TD>
<TD WIDTH="55%"><FONT FACE="Arial" SIZE="2"><?=$email3?></FONT></TD>
</TR>
<TR>
<TD WIDTH="45%"><DIV ALIGN="CENTER"><FONT SIZE="2" FACE="Arial"><B>Friends Email:</B></FONT></DIV></TD>
<TD WIDTH="55%"><FONT FACE="Arial" SIZE="2"><?=$email4?></FONT></TD>
</TR>
<TR>
<TD WIDTH="45%"><DIV ALIGN="CENTER"><FONT SIZE="2" FACE="Arial"><B>Friends Email:</B></FONT></DIV></TD>
<TD WIDTH="55%"><FONT FACE="Arial" SIZE="2"><?=$email5?></FONT></TD>
</TR>
</TABLE>

<font face="Arial" size="2"></form><br></font></div><div align="center">
<br></div>
<table width="600" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td><hr size="2"></td>
</tr>
</table>

<!-- End Thank you -->
<?php
}
## END OF SUBMIT ##

?>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> <?=$sitename?> </TITLE>
<META NAME="Keywords" CONTENT="<?=$keywords?>">
<META NAME="Description" CONTENT="<?=$des?>">
</HEAD>

<body bgcolor="<?=$color3?>" text="<?=$textcolor?>">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><?=$header?></td>
</tr>
</table>

<form action="<?=$PHP_SELF?>" method="post">
<table width="600" align="center">
<tr>
<td width="50%" bgcolor="<?=$color2?>"> <div align="right"><font size="2" face="Arial"><b>Your Email</b></font></div></td>
<td width="50%" bgcolor="<?=$color2?>"> <input type="text" name="email1" maxlength="100"></td>
</tr>
<tr>
<td width="50%" bgcolor="<?=$color2?>"><div align="right"><font size="2" face="Arial"><b>Friends Email 1</b></font></div></td>
<td width="50%" bgcolor="<?=$color2?>"><input type="text" name="email2" maxlength="100"></td>
</tr>
<TR>
<TD WIDTH="50%" BGCOLOR="<?=$color2?>"><DIV ALIGN="right"><FONT SIZE="2" FACE="Arial"><B>Friends Email 2</B></FONT></DIV></TD>
<TD WIDTH="50%" BGCOLOR="<?=$color2?>"> <INPUT TYPE="text" NAME="email3" MAXLENGTH="100"></TD>
</TR>
<TR>
<TD WIDTH="50%" BGCOLOR="<?=$color2?>"><DIV ALIGN="right"><FONT SIZE="2" FACE="Arial"><B>Friends Email 3</B></FONT></DIV></TD>
<TD WIDTH="50%" BGCOLOR="<?=$color2?>"><INPUT TYPE="text" NAME="email4" MAXLENGTH="100"></TD>
</TR>
<TR>
<TD WIDTH="50%" BGCOLOR="<?=$color2?>"><DIV ALIGN="right"><FONT SIZE="2" FACE="Arial"><B>Friends Email 4</B></FONT></DIV></TD>
<TD WIDTH="50%" BGCOLOR="<?=$color2?>"><INPUT TYPE="text" NAME="email5" MAXLENGTH="100"> </TD>
</TR>
<tr>
<td width="50%">&</td><td width="50%"><input type="submit" name="submit" value="SUBMIT"></td>
</tr>
</table>
</form>

<!-- Do not remove this copyright notice -->
<table width="100%" border="0" cellspacing="5" cellpadding="5">
<tr>
<td><div align="center"><font face="verdana" size="1"><b>Powered by</b>: <a href="http://www.boxxnet.com">Tell-A-Friend ND</a>
Version 1.0<br> Copyright ©2002, BoxxNet Limited.</font></div></td>
</tr>
</table>
<!-- Do not remove this copyright notice -->


<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><?=$footer?></td>
</tr>
</table>

</body>
</html>
2 REPLIES
N/A

Recommend a friend script

Type in http://cgi.saltshaker.force9.co.uk and your file can be seen.

Martin
N/A

How dumb do I feel

Shockedops:

I guess I was trying to view it too quickly after uploading it!

Cheers