Hi !
I need to include a send to friend in each new from my website
For that task i am including a php (at the bottom of the message
and takes the url by the http_referer method
But it do not take the correct url with the correct reference as :
http://www.website.com/midia/release_vermsg.php?titulo=&id=33
it takes a wrong reference
http://www.website.com/midia/index_release.php
how can i get the correct reference ?
and more: http_referer takes index_release.php and not release_vermsg.php wich is the correct php to show each new,
index_release.php just show title and link to the new.
Thank´s in advance
Send to friend script:
<b>Send to friend!</b>
<p>
<?php
If ($to_email && $message && $subject) {$to = "\"$to_name\" <$to_email>";
$from = "\"$from_name\" <$from_email>";
$to = str_replace("\'", "'", $to);
$from = str_replace("\'", "'", $from);$subject = str_replace("\'", "'", $subject);
$message = str_replace("\'", "'", $message);
mail($to, $subject, $message, "From: $from\nX-Mailer: Colégio Anchieta");
echo "Mail message sent : \nTo : $to\nFrom : $from\nSubject : $subject\nMessage : $message";
exit; } ?>
<form action=<?php echo $PHP_SELF; ?> METHOD=POST>
<TABLE>
<TR>
<TD>To (to_name):</TD>
</TR>
<TR>
<TD><input type=text name=to_name></TD>
</TR>
<TR>
<TD>E-mail (to_email):</TD>
</TR>
<TR>
<TD><input type=text name=to_email></TD>
</TR>
<TR>
<TD>From (from_name):</TD>
</TR>
<TR>
<TD><input type=text name=from_name></TD>
</TR>
<TR>
<TD>E-mail (from_email):</TD>
</TR>
<TR>
<TD><input type=text name=from_email></TD>
</TR>
<TR>
<TD>subject :</TD>
</TR>
<TR>
<TD><input type=text name=subject></TD>
</TR>
<TR>
<TD>Message:<BR> <textarea name=message cols=20 rows=10>
Olá!
Encontrei esta notícia e achei interessante.
Link:
<? if (empty($HTTP_REFERER)) { $referrer = 'No referrer reported'; } else { $referrer = $HTTP_REFERER; } echo $referrer; ?>
</textarea></TD>
</TR>
<TR>
<TD><input type=submit value=Mail></form></TD>
</TR>
</TABLE>