salut les gars,
je suis vraiment un tres nul en code je poste d'ailleurs sur le groupe java
car si y'a mieux en java je suis preneur
j'ai pris que les divers site un code permettant de prendre l'url d'une page
et de l'envoyer a un ami par mail... en fait c'est le propre surfeur qui va
la recevoir en tapant sous email apres l'invitation a le faire... c'est du
bidouillage je le concois...
mais moi le webmaster voudairs avois une copie cachee de cet envoi...
pouvez vous m'aider...
En fait l'ideal cé que le gars puisse s'envoyer seulement le lien menant a
la page qui l'interesse pour que je n'ai a placer dans la dite page (qui se
veut grahique et esthetique)l'interface d'envoi,il referme cette page (qui
est dans un popup) et retombe sur une page lui rappelant le lien qu'il peut
s'envoyer par mail... avec copie cache
suis pas tres clair?
voila mon code voici mes 2 fichiers ,c'est ce que j'ai trouver de mieux mais
ca m'oblige a placer envoyer cette page dans la page graphique
merci pour votre aide
1 ----config.php
Code : Tout sélectionner
<?
//--- Must Edit The Following
Variables ---------------------------------------------------//
$auto_responder ="yes";
$url="http://jlucz.webzzanine/templates";
$admin_mail="[email protected]";
$title="Ajouter à vos preférés";
$your_website = "Tout pour le Webmaster";
$thankyousubject="Merci pour votre choix!";
//--- Edit The Stylesheet
Here! ----------------------------------------------------------//
$font="verdana"; // eg. verdana, arial, tahoma
$fontcolor="#000000"; // hex colour value
$fontsize="10pt"; // enter size in 'pt' i.e: 10pt
$formfontsize="8pt";
$formbgcolor="#0099CC";
$formfontcolor="#FFFFFF";
$scrollbars="#0099CC";
$scrollarrows="#FFFFFF";
//--- Do NOT Edit! THESE ARE FOR THE
FORM! ----------------------------------------------------------------//
$yourname="Votre nom"; // do not be stupid and put your name here!
$yourmail="Votre E-mail";
$recipientmail="L'E-mail ou vous voulez recevoir le lien";
$yourmessage="Notes sur le lien ";
//--- Edit these if you
wish -------------------------------------------------------------//
$submitbutton="Ajoutez à vos préférés";
$suggest_exp="Vous avez souhaité recevoir ce lien par mail..."; // good
idea to have dots at the end, or a colon :
$send_subject = "Visitez le";
$thankyoumessage="Votre lien a été envoyé sur $link to your friend.";
//--- Please credit the script by not editing this
: ) --------------------------------------//
//--- End of Config
?>
_____________
2 ------ friend.php
<?
include("config.php");
if(!isset($_GET['js']) || $_GET['js'] == ""){
$link = $url.$_GET['id'];
}
else if($_GET['js'] == "on"){
$link = $_GET['id'];
}
$link = str_replace(" ","+", $link); // get rid of spaces
if(!isset($_POST['action']) || $_POST['action'] == ""){
if(!isset($link)){
print "No Link Specified";
}
else{
printpage("","","","");
}
}
else if($_POST['action'] == "submit"){
$send = true;
function is_valid_email($sender_mail) {
if(ereg("([[:alnum:]\.\-]+)(\@[[:alnum:]\.\-]+\.+)", $sender_mail)) {
return 0;
}
else{
return 1;
}
}
$sender_mail = $_POST['sender_mail'];
$friend_mail = $_POST['friend_mail'];
$sender_name = $_POST['sender_name'];
$optional_message = $_POST['optional_message'];
$link = $_POST['link'];
$js = $_POST['js'];
$id = $_POST['id'];
$s_emailvalid = is_valid_email($sender_mail); // check email
$f_emailvalid = is_valid_email($friend_mail); // check email
$emsg = "Erreur sur votre page:<br><br>\n";
if ($sender_name == ""){
$emsg .= "Votre nom:<br>\n";
$send = false;
}
if ($sender_mail == "" || $s_emailvalid == 1){
$emsg .= "Votre E-mail<br>\n";
$send = false;
}
if ($friend_mail == "" || $f_emailvalid == 1){
$emsg .= "L' E-mail ou vous desirez recevoir le lien<br>\n";
$send = false;
}
if($send){
$recipient = "$friend_mail";
$message .= "Vous avez souhaité recevoir ce lien par mail:\n$link\n\n";
if($optional_message != ""){
$message .= "Note sur le lien:\n$optional_message\n\n";
}
$headers = "From: $sender_name <$sender_mail>\r\nReply-To:
$sender_mail\r\n";
mail ($recipient, $send_subject, $message, $headers);
if($auto_responder == "yes"){
$recipient2 = "$sender_name <$sender_mail>";
$subject2 = "$thankyousubject";
$message2 = "$thankyoumessage\n\n$your_website\n$admin_mail\n\n» Note:
This is an automated response, please do not reply to this\n\n";
$message2 .= "Send Page V2.0 PopUp - © http://www.cj-design.com 2003";
$headers2 = "From: $your_website <$admin_email>\r\nReply-To:
$admin_mail\r\n";
mail ($recipient2, $subject2, $message2, $headers2);
}
printthanks($sender_name,$friend_mail,$link);
exit;
}
else if(!$send){
printpage($sender_name,$sender_mail,$friend_mail,$emsg);
}
}
else{
printpage("","","","");
}
function printpage($sender_name,$sender_mail,$friend_mail,$errors){
include("config.php");
global $link, $id, $js;
?>
<html>
<head>
<META NAME="Title" CONTENT="<? echo $title; ?>">
<META NAME="Author" CONTENT="James Crooke - CJ Web Design">
<title>Send <? echo $link; ?> to a friend!</title>
<link rel="stylesheet" href="stylesheet.php" type="text/css">
</head>
<body>
<form method="post" action="friend.php">
<input type="hidden" name="link" value="<? echo $link; ?>">
<input type="hidden" name="id" value="<? echo $id; ?>">
<input type="hidden" name="js" value="<? echo $js; ?>">
<input type="hidden" name="action" value="submit">
<font color="red"><b><? echo $errors; ?></b></font><p>
<table width="600" border="0" cellspacing="0" cellpadding="5">
<tr>
<td colspan="2" width="625"><font size="3"><b><? echo $title;
?></b></font></td>
</tr>
<tr>
<td colspan="2" width="625"><? echo $suggest_exp; ?><br><small><? echo
$link; ?></small></td>
</tr>
<tr>
<td width="232"><? echo $yourname; ?> </td>
<td width="381"><input type="text" value="<? echo $sender_name; ?>"
name="sender_name" size="40"></td>
</tr>
<tr>
<td width="232"><? echo $yourmail; ?></td>
<td width="381"><input type="text" value="<? echo $sender_mail; ?>"
name="sender_mail" size="40"></td>
</tr>
<tr>
<td width="232"><? echo $recipientmail; ?></td>
<td width="381"><input type="text" value="<? echo $friend_mail; ?>"
name="friend_mail" size="40"></td>
</tr>
<tr>
<td width="232"><? echo $yourmessage; ?></td>
<td width="381"><textarea name="optional_message" cols="45"
rows="8"></textarea></td>
</tr>
<tr>
<td width="232"> </td>
<td width="381">
<div align="left">
<input type="submit" name="submit" value="<? echo $submitbutton;
?>">
</div>
</td>
</tr>
</table>
</form>
</body>
</html>
<?
}
function printthanks($sender_name,$friend_mail,$link){
include("config.php");
?>
<html>
<head>
<META NAME="Title" CONTENT="<? echo $title; ?>">
<META NAME="Author" CONTENT="James Crooke - CJ Web Design">
<title>Thanks for sending <? echo $link; ?> to a friend!</title>
<link rel="stylesheet" href="stylesheet.php" type="text/css">
</head>
<body topmargin="20" leftmargin="20">
Thank you <? echo $sender_name; ?> for sending..<br><? echo $link; ?> to a
friend!
<p>
<center>
<A HREF="javascript:window.close();">Close window</A>
</center>
</body>
</html>
<?
}
?>
merci pour votre aide
salut les gars,
je suis vraiment un tres nul en code je poste d'ailleurs sur le groupe java
car si y'a mieux en java je suis preneur
j'ai pris que les divers site un code permettant de prendre l'url d'une page
et de l'envoyer a un ami par mail... en fait c'est le propre surfeur qui va
la recevoir en tapant sous email apres l'invitation a le faire... c'est du
bidouillage je le concois...
mais moi le webmaster voudairs avois une copie cachee de cet envoi...
pouvez vous m'aider...
En fait l'ideal cé que le gars puisse s'envoyer seulement le lien menant a
la page qui l'interesse pour que je n'ai a placer dans la dite page (qui se
veut grahique et esthetique)l'interface d'envoi,il referme cette page (qui
est dans un popup) et retombe sur une page lui rappelant le lien qu'il peut
s'envoyer par mail... avec copie cache
suis pas tres clair?
voila mon code voici mes 2 fichiers ,c'est ce que j'ai trouver de mieux mais
ca m'oblige a placer envoyer cette page dans la page graphique
merci pour votre aide
1 ----config.php
[code]
<?
//--- Must Edit The Following
Variables ---------------------------------------------------//
$auto_responder ="yes";
$url="http://jlucz.webzzanine/templates";
$admin_mail="
[email protected]";
$title="Ajouter à vos preférés";
$your_website = "Tout pour le Webmaster";
$thankyousubject="Merci pour votre choix!";
//--- Edit The Stylesheet
Here! ----------------------------------------------------------//
$font="verdana"; // eg. verdana, arial, tahoma
$fontcolor="#000000"; // hex colour value
$fontsize="10pt"; // enter size in 'pt' i.e: 10pt
$formfontsize="8pt";
$formbgcolor="#0099CC";
$formfontcolor="#FFFFFF";
$scrollbars="#0099CC";
$scrollarrows="#FFFFFF";
//--- Do NOT Edit! THESE ARE FOR THE
FORM! ----------------------------------------------------------------//
$yourname="Votre nom"; // do not be stupid and put your name here!
$yourmail="Votre E-mail";
$recipientmail="L'E-mail ou vous voulez recevoir le lien";
$yourmessage="Notes sur le lien ";
//--- Edit these if you
wish -------------------------------------------------------------//
$submitbutton="Ajoutez à vos préférés";
$suggest_exp="Vous avez souhaité recevoir ce lien par mail..."; // good
idea to have dots at the end, or a colon :
$send_subject = "Visitez le";
$thankyoumessage="Votre lien a été envoyé sur $link to your friend.";
//--- Please credit the script by not editing this
: ) --------------------------------------//
//--- End of Config
?>
_____________
2 ------ friend.php
<?
include("config.php");
if(!isset($_GET['js']) || $_GET['js'] == ""){
$link = $url.$_GET['id'];
}
else if($_GET['js'] == "on"){
$link = $_GET['id'];
}
$link = str_replace(" ","+", $link); // get rid of spaces
if(!isset($_POST['action']) || $_POST['action'] == ""){
if(!isset($link)){
print "No Link Specified";
}
else{
printpage("","","","");
}
}
else if($_POST['action'] == "submit"){
$send = true;
function is_valid_email($sender_mail) {
if(ereg("([[:alnum:]\.\-]+)(\@[[:alnum:]\.\-]+\.+)", $sender_mail)) {
return 0;
}
else{
return 1;
}
}
$sender_mail = $_POST['sender_mail'];
$friend_mail = $_POST['friend_mail'];
$sender_name = $_POST['sender_name'];
$optional_message = $_POST['optional_message'];
$link = $_POST['link'];
$js = $_POST['js'];
$id = $_POST['id'];
$s_emailvalid = is_valid_email($sender_mail); // check email
$f_emailvalid = is_valid_email($friend_mail); // check email
$emsg = "Erreur sur votre page:<br><br>\n";
if ($sender_name == ""){
$emsg .= "Votre nom:<br>\n";
$send = false;
}
if ($sender_mail == "" || $s_emailvalid == 1){
$emsg .= "Votre E-mail<br>\n";
$send = false;
}
if ($friend_mail == "" || $f_emailvalid == 1){
$emsg .= "L' E-mail ou vous desirez recevoir le lien<br>\n";
$send = false;
}
if($send){
$recipient = "$friend_mail";
$message .= "Vous avez souhaité recevoir ce lien par mail:\n$link\n\n";
if($optional_message != ""){
$message .= "Note sur le lien:\n$optional_message\n\n";
}
$headers = "From: $sender_name <$sender_mail>\r\nReply-To:
$sender_mail\r\n";
mail ($recipient, $send_subject, $message, $headers);
if($auto_responder == "yes"){
$recipient2 = "$sender_name <$sender_mail>";
$subject2 = "$thankyousubject";
$message2 = "$thankyoumessage\n\n$your_website\n$admin_mail\n\n» Note:
This is an automated response, please do not reply to this\n\n";
$message2 .= "Send Page V2.0 PopUp - © http://www.cj-design.com 2003";
$headers2 = "From: $your_website <$admin_email>\r\nReply-To:
$admin_mail\r\n";
mail ($recipient2, $subject2, $message2, $headers2);
}
printthanks($sender_name,$friend_mail,$link);
exit;
}
else if(!$send){
printpage($sender_name,$sender_mail,$friend_mail,$emsg);
}
}
else{
printpage("","","","");
}
function printpage($sender_name,$sender_mail,$friend_mail,$errors){
include("config.php");
global $link, $id, $js;
?>
<html>
<head>
<META NAME="Title" CONTENT="<? echo $title; ?>">
<META NAME="Author" CONTENT="James Crooke - CJ Web Design">
<title>Send <? echo $link; ?> to a friend!</title>
<link rel="stylesheet" href="stylesheet.php" type="text/css">
</head>
<body>
<form method="post" action="friend.php">
<input type="hidden" name="link" value="<? echo $link; ?>">
<input type="hidden" name="id" value="<? echo $id; ?>">
<input type="hidden" name="js" value="<? echo $js; ?>">
<input type="hidden" name="action" value="submit">
<font color="red"><b><? echo $errors; ?></b></font><p>
<table width="600" border="0" cellspacing="0" cellpadding="5">
<tr>
<td colspan="2" width="625"><font size="3"><b><? echo $title;
?></b></font></td>
</tr>
<tr>
<td colspan="2" width="625"><? echo $suggest_exp; ?><br><small><? echo
$link; ?></small></td>
</tr>
<tr>
<td width="232"><? echo $yourname; ?> </td>
<td width="381"><input type="text" value="<? echo $sender_name; ?>"
name="sender_name" size="40"></td>
</tr>
<tr>
<td width="232"><? echo $yourmail; ?></td>
<td width="381"><input type="text" value="<? echo $sender_mail; ?>"
name="sender_mail" size="40"></td>
</tr>
<tr>
<td width="232"><? echo $recipientmail; ?></td>
<td width="381"><input type="text" value="<? echo $friend_mail; ?>"
name="friend_mail" size="40"></td>
</tr>
<tr>
<td width="232"><? echo $yourmessage; ?></td>
<td width="381"><textarea name="optional_message" cols="45"
rows="8"></textarea></td>
</tr>
<tr>
<td width="232"> </td>
<td width="381">
<div align="left">
<input type="submit" name="submit" value="<? echo $submitbutton;
?>">
</div>
</td>
</tr>
</table>
</form>
</body>
</html>
<?
}
function printthanks($sender_name,$friend_mail,$link){
include("config.php");
?>
<html>
<head>
<META NAME="Title" CONTENT="<? echo $title; ?>">
<META NAME="Author" CONTENT="James Crooke - CJ Web Design">
<title>Thanks for sending <? echo $link; ?> to a friend!</title>
<link rel="stylesheet" href="stylesheet.php" type="text/css">
</head>
<body topmargin="20" leftmargin="20">
Thank you <? echo $sender_name; ?> for sending..<br><? echo $link; ?> to a
friend!
<p>
<center>
<A HREF="javascript:window.close();">Close window</A>
</center>
</body>
</html>
<?
}
[/code]
?>
merci pour votre aide