Web Hosting Vodahost    

Home Take The Royal Tour! Order Now Features Prices
Go Back   Web Hosting > VodaHost Web Hosting Support > Scripts & Fantastico

Notices

Scripts & Fantastico Discussions, help and troubleshooting scripts included is adding popular Fantastico scripts to your website such as guest books, osCommerce shopping cart, polls, content management systems etc…

Reply
 
LinkBack Thread Tools
  #1  
Old 11-10-2006, 06:25 PM
Private First Class
 
Join Date: Nov 2006
Posts: 6
Smile Newbie, pleas help will tell a friend script

Hi :)
I am trying to find a tell a friend field with a minimum of 3 email fields thats fully customisable, that allows you to redirect the visitor to a thank you page after completion (I've set this up as a test run)
But I get a pars error on line 41, Please help :)
Any help would be so appreciated.
Big Thanks In Advance
Lea

here is the first part (saved a tellafriend.php)

<?php

// This following statement must not be changed.
// Copyright (c) Michael Bloch and Taming The Beast.
// Tell-A-Friend script V 2.1 Updated September 19 2006
// Taming the Beast.net - http://www.tamingthebeast.net
// Free Web Marketing and Ecommerce Resources and Tools
// By using this script you agree to indemnify Taming the Beast
// from from any liability that might arise from its use.
// The preceding statement must not be changed.
if(count($_POST)) {
# This part strips out nasty code that a malicious
# person may try to inject into the form
foreach(array('fmail1','fmail2','fmail3','email',' name') as $key) $_POST[$key] = strip_tags($_POST[$key]);
if(!is_secure($_POST)) { die("Hackers begone");}
# This part submits a notification to you when
# the form is submitted
// Email address for copies to be sent to - change to suit
$emailto = "grant774m****.com";
// Notification email subject text for copies
$esubject = "Recommendation form submission";
// Email body text for notifications
$emailtext = "
$_POST[name] has used your recommendation form using an email address of $_POST[email]
The people the recommendation has been submitted to are:
$_POST[fmail1]
$_POST[fmail2]
$_POST[fmail3]
The page recommended:
$_POST[refurl]
";
# This function sends the email to you
*****("$emailto", $esubject, $emailtext, "From: $_POST[email]");
# This part is the function for sending to recipients
// Page to display after successful submission
// Change the thankyou.htm to suit
$thankyoupage = "www.lm-lakeland-design.co.uk/LM/Thank_You.htm";
// Subject line for the recommendation - change to suit
$tsubject = "A web page recommendation from $_POST[name]";
// Change the text below for the email
// Be careful not to change anyt "$_POST[value]" bits
$ttext = "
Hi,
$_POST[name], whose email address is $_POST[email] thought you may be interested in this web page.
$_POST[refurl]
$_POST[name] has used our Tell-a-Friend form to send you this note.
We look forward to your visit!
";
# This sends the note to the addresses submitted
*****("$_POST[fmail1],$_POST[fmail2],$_POST[fmail3]", $tsubject, $ttext, "FROM: $_POST[email]");
# After submission, the thank you page
header("Location: $thankyoupage");
exit;
}
# Nothing further can be changed. Leave the below as is
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;
}
?>


This is the form saved as recform.php

<html>
<head>
<title>Recommendation form</title>
<script language="javascript">
<!--
function reset() {
document.tellafriend.name.value="";
document.tellafriend.email.value="";
document.tellafriend.fmail1.value="";
document.tellafriend.fmail2.value="";
document.tellafriend.fmail3.value="";
}
function validate() {

if (document.tellafriend.fmail1.value.length==0) {
alert("Oops! you'll need to enter a friend's email address");
return false;
}
if (document.tellafriend.email.value.length==0) {
alert("Oops! you forget to enter your email address");
return false;
}
if (document.tellafriend.name.value.length==0) {
alert("Oops! you forgot to enter your name");
return false;
}
document.tellafriend.submit()
return true;
}
//-->
</script>
</head>
<body onload="reset()" topmargin="0" leftmargin="0">
<p>
<center>
</center>
<table width="450" cellpadding="0" cellspacing="0" align="center">
<tr valign="top">
<td valign="middle" align="center">&nbsp;
Complete the details below to send a link to the page:<br>
<? $refurl = $_SERVER['HTTP_REFERER']; ?>
<? print $refurl;?>
<form name="tellafriend" action="tellafriend.php" method="post" onsubmit="return checkfields()">&nbsp;
<div align="center">
<center>
<table border="0" cellpadding="10" cellspacing="0">
<tr>
<td> *your name:</td>
<td>
<input size="30" name="name" maxlength="45">
</td>
</tr>
<tr>
<td>*your email:</td>
<td>
<input size="30" name="email" maxlength="45">
</td>
</tr>
<tr>
<td colspan="2">
<p align="center">Enter your friend's email addresses:</td>
</tr>
<tr>
<td>*email 1:</td>
<td>
<input size="30" name="fmail1" maxlength="50">
</td>
</tr>
<tr>
<td>email 2:</td>
<td>
<input size="30" name="fmail2" maxlength="50">
</td>
</tr>
<tr>
<td>email 3:</td>
<td>
<input size="30" name="fmail3" maxlength="50">
</td>
</tr>
<tr>
<td colspan="2">
<p align="center">
The email that will be sent to will contain your name &amp; email address. <br>
<input onclick="validate();" type="button" value="click once to send">
<input type=hidden name=refurl value="<? print $refurl;?>">
</td>
</tr>
</table>
</center>
</div>
</form>
</td>
</tr>
<tr valign="top">
<td valign="middle" align="center">
&nbsp;
</td>
</tr>
</table>
</body>
</html>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2  
Old 12-30-2007, 02:01 AM
Private
 
Join Date: Dec 2007
Posts: 1
Default Re: Newbie, pleas help will tell a friend script

The second page is html, change its name from recform.php to recform.html. Don't forget to upload a thankyou page in the folder LM, it is best to name it thankyou.htm instead of Thank You.htm and amend the variable in the tellafriend.php page to:
$thankyoupage = "www.lm-lakeland-design.co.uk/LM/thankyou.htm";
Hope this will solve the problem.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply


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


All times are GMT +1. The time now is 01:31 PM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC7
2007 VodaHost.com - All Rights Reserved

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