Uhm...
La poca conoscenza di linguaggi come il PHP, potrebbe renderti le cose difficili.![]()
1) Il link "invia ad un amico", deve puntare ad un indirizzo tipo "sendtoafriend.php?video=cod"
dove "cod" è deve essere sostituito con un codice che identifichi il video (nel nostro caso 37)
2) Non hai specificato se nell'e-mail deve essere inviata tutta la pagina o solo il video.
La pagina sendtoafriend.php dovrebbe essere qualcosa di simile:
<?
if (!isset($_GET['video'])) {
echo "Errore, codice video non specificato";
die();
}
$video = $_GET['video'];
if (isset($_POST['from'])) {
$target = $_POST['dest1'];
$subject = $_POST['subject'];
$header = "From: <".$_POST['email'].">\r\nReply-To: ".$_POST['email']."\r\nX-Mailer: PHP/4.0.2\r\nContent-Type: text/html";
$text = $_POST['html'] . "\n" . $_POST['commento'];
mail($target, $subject, $text, $header);
if ($_POST['dest2'] != "") {
$target = $_POST['dest2'];
mail($target, $subject, $text, $header);
}
echo "E-mail inviata correttamete";
}
?>
<html>
<head>
<title>Invia il video ad un amico</title>
</head>
<body>
<form action="sendtoafriend.php?video=<?= $video; ?>" method="post">
La tua email: <input type=text name=email />
Primo destinatario: <input type=text name=dest1 />
Secondo destinatario: <input type=text name=dest2 /> Opzionale
Commenti:
<textarea cols=60 rows=10 name=commento></textarea>
<textarea style="visibility:hidden;" name=html id=html></textarea>
</body>
</html>
nella textarea con id html (che sarà nascosta a chi invia l'email), deve andarci tutto l'html che dovrà essere inviato. Es:
<textarea style="visibility:hidden" name=html id=html>
<object>
<param ...>
...
...
</object>
</textarea>
Aiutati con la variabile $video.![]()
Fammi sapere![]()