tellafriend
--Ergens in je site.
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
<form name="mailafriend" method="post" action="mailafriend.php">
<h5>Tell a Friend</h5>
<i>Afzender:</i><br />
Uw naam:<br />
<input type="text" name="naam" /><br />
E-mailadres:<br />
<input type="text" name="from" /><br /><br />
<i>Bestemming:</i><br />
Naam ontvanger:<br />
<input type="text" name="vriend" /><br />
E-mailadres:<br />
<input type="text" name="to" /><br />
<input type="submit" value="Verstuur >>" class="button">
</form>
<h5>Tell a Friend</h5>
<i>Afzender:</i><br />
Uw naam:<br />
<input type="text" name="naam" /><br />
E-mailadres:<br />
<input type="text" name="from" /><br /><br />
<i>Bestemming:</i><br />
Naam ontvanger:<br />
<input type="text" name="vriend" /><br />
E-mailadres:<br />
<input type="text" name="to" /><br />
<input type="submit" value="Verstuur >>" class="button">
</form>
--mailafriend.php
Code (php)
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?php
if (!isset($_POST['linkje']))
{
$linkje = $_SERVER['HTTP_REFERER'];
}
else
{
$linkje = $_POST['linkje'];
}
list($htmlfile) = explode ("/", strrev($linkje));
$bestand = strrev($htmlfile);
$error = '
<i>U heeft enkele velden niet (correct) ingevuld; Vul ze alstublieft in:</i>
<form method="post" action="mailafriend.php">
<input type="hidden" name="linkje" value="'. htmlentities($_POST['linkje']) .'" />
<br /><br />
<i>Afzender:</i><br />
Uw naam:<br />
<input type="text" name="naam" value="'. htmlentities($_POST['naam']) .'" /><br />
E-mailadres:<br />
<input type="text" name="from" value="'. htmlentities($_POST['from']) .'" /><br /><br />
<i>Bestemming:</i><br />
Naam ontvanger:<br />
<input type="text" name="vriend" value="'. htmlentities($_POST['vriend']) .'" /><br />
E-mailadres:<br />
<input type="text" name="to" value="'. htmlentities($_POST['to']) .'" /><br /><br />
<input type="submit" value="Verstuur >>" />
</form>';
// Grijp de waarden uit html file
$titel = @shell_exec("grep 'meta name=\"title\"' $bestand|cut -d'\"' -f4|cut -d'\"' -f1");
$auteur = @shell_exec("grep 'meta name=\"author\"' $bestand|cut -d'\"' -f4|cut -d'\"' -f1");
$desc = @shell_exec("grep 'meta name=\"description\"' $bestand|cut -d'\"' -f4|cut -d'\"' -f1");
if ($_POST['to'] == "" || $_POST['from'] == "" || $_POST['vriend'] == "" || $_POST['naam'] == "" || substr_count($_POST['from'], "@") == 0 || substr_count($_POST['to'], "@") == 0)
{
echo $error;
}
else
{
$message = '
Beste '. $_POST['vriend'] .'
'. $_POST['naam'] .' denkt dat jij dit een interessant artikel vindt.
'. $_POST['titel'] .' - '. $_POST['auteur'] . $_POST['desc'] . $_POST['linkje'] .'
--
Sitsat.nl
email: [email protected]
website: http://www.sitsat.nl';
$subject = '[sitsat.nl] '. $_POST['titel'];
$headers .= 'From: '. $_POST['naam'] .' <'. $_POST['from'] .">\r\n";
$headers .= 'X-Mailer: Phphulp Mail-A-Friend';
mail($_POST['to'], $subject, $message, $headers);
echo '
<p>Beste '. $_POST['naam'] .'</p>
<p>
Het e-mailtje is verstuurd. </p><p>
Ga terug naar de <a href="javascript:history.back(-1)">vorige pagina</a> of kies een onderdeel uit het menu.</a>
</p>';
}
?>
if (!isset($_POST['linkje']))
{
$linkje = $_SERVER['HTTP_REFERER'];
}
else
{
$linkje = $_POST['linkje'];
}
list($htmlfile) = explode ("/", strrev($linkje));
$bestand = strrev($htmlfile);
$error = '
<i>U heeft enkele velden niet (correct) ingevuld; Vul ze alstublieft in:</i>
<form method="post" action="mailafriend.php">
<input type="hidden" name="linkje" value="'. htmlentities($_POST['linkje']) .'" />
<br /><br />
<i>Afzender:</i><br />
Uw naam:<br />
<input type="text" name="naam" value="'. htmlentities($_POST['naam']) .'" /><br />
E-mailadres:<br />
<input type="text" name="from" value="'. htmlentities($_POST['from']) .'" /><br /><br />
<i>Bestemming:</i><br />
Naam ontvanger:<br />
<input type="text" name="vriend" value="'. htmlentities($_POST['vriend']) .'" /><br />
E-mailadres:<br />
<input type="text" name="to" value="'. htmlentities($_POST['to']) .'" /><br /><br />
<input type="submit" value="Verstuur >>" />
</form>';
// Grijp de waarden uit html file
$titel = @shell_exec("grep 'meta name=\"title\"' $bestand|cut -d'\"' -f4|cut -d'\"' -f1");
$auteur = @shell_exec("grep 'meta name=\"author\"' $bestand|cut -d'\"' -f4|cut -d'\"' -f1");
$desc = @shell_exec("grep 'meta name=\"description\"' $bestand|cut -d'\"' -f4|cut -d'\"' -f1");
if ($_POST['to'] == "" || $_POST['from'] == "" || $_POST['vriend'] == "" || $_POST['naam'] == "" || substr_count($_POST['from'], "@") == 0 || substr_count($_POST['to'], "@") == 0)
{
echo $error;
}
else
{
$message = '
Beste '. $_POST['vriend'] .'
'. $_POST['naam'] .' denkt dat jij dit een interessant artikel vindt.
'. $_POST['titel'] .' - '. $_POST['auteur'] . $_POST['desc'] . $_POST['linkje'] .'
--
Sitsat.nl
email: [email protected]
website: http://www.sitsat.nl';
$subject = '[sitsat.nl] '. $_POST['titel'];
$headers .= 'From: '. $_POST['naam'] .' <'. $_POST['from'] .">\r\n";
$headers .= 'X-Mailer: Phphulp Mail-A-Friend';
mail($_POST['to'], $subject, $message, $headers);
echo '
<p>Beste '. $_POST['naam'] .'</p>
<p>
Het e-mailtje is verstuurd. </p><p>
Ga terug naar de <a href="javascript:history.back(-1)">vorige pagina</a> of kies een onderdeel uit het menu.</a>
</p>';
}
?>