You can't do a tell a firend  script on the same page as your mail.
1. link all the pages you want to have mailed to a page that has a form 
on it.
2 on the page with the form you collect the info you want like the 
example below. Notice the hidden field. The form action passes the stuff 
off to the mail script mailfriend.php or what ever you name it. collect 
all the variable in the mail() script.

<form method="post" action="mailfriend.php">
   <input type="hidden" value="<? echo("$HTTP_REFERER");?>" name="url">
   Friends Email:
   <input type="text" name="email" size="25">
   <br>
   <br>
   Your Name:
   <input type="text" size="25" name="friend">
   <br>
   <br>
   Your Email:
   <input type="text" size="25" name="referer">
   <br>
   <input type="submit" name="Submit" value="Submit">


HTH
Gary


Renato Salvatore Moya L. wrote:

> ah! ,i to me it forgot i try only $HTTP_REFERER and not result
> 
> "Renato Salvatore Moya L." ha escrito:
> 
>     ok gays, thank for all, but i try and no result good :-(
> 
>     look this :
> 
>     My PHP-Script :
> 
>     <?
>     echo ' Prueba de Email<br>';
>     echo ' Enviar esta página a un amigo<br>';
>     $referer = getenv("HTTP_REFERERl");
>     mail ('[EMAIL PROTECTED]','Prueba de email',$referer);
>     echo ' enviado..';
>     ?>
> 
>     Well this script i execute and the result is:
> 
>     Prueba de Email
>     Enviar esta página a un amigo
> 
>     https://thorin.reuna.cl:10000/init/edit_action.cgi?0+httpd
> 
>     enviado..
> 
>      this is not my URL, so I need the URL that I am visiting
>      
> 
>     Thank
> 
>     Renato
>      
> 
>     "Keith V. (Vance Consulting LLC)" ha escrito:
> 
>         On 13 Feb 2002 at 14:40, Rick Emery wrote:
> 
>          > Renato,
>          >
>          > To send mail, use PHP's mail() function:
>          > mail($recipient,$subject,$message,$headers);
>          >
>          > You can reference $HTTP_REFERER directly without saying
>         getenv(HTTP_REFERER)
> 
>         Yeah, and if your mail function is being called within a
>         function, just say:
>         global $HTTP_REFERER;
> 
>         Hope that helps.
>          >
>          > -----Original Message-----
>          > From: Renato Salvatore Moya L. [mailto:[EMAIL PROTECTED]]
>          > Sent: Wednesday, February 13, 2002 2:34 PM
>          > To: [EMAIL PROTECTED]; Stalmannen
>          > Subject: [PHP] Re: mail headers
>          > Importance: High
>          >
>          >
>          > Hi, i'm writte from Chile. If you writte to little php-script
>         for send mail,
>          > what send you mail ?.
>          >
>          > I question you, because i'm writte a tipical php-script "
>         tell a friend",
>          > but i have problems with "getenv(HTPP_REFERER)", because send
>         only my https
>          > fixed.
>          >
>          > Renato.
>          >
>          > Stalmannen ha escrito:
>          >
>          > > Hej!
>          > >
>          > > I have a question. I send mail from a php-script with the
>         mail()-function.
>          > However the smtp server I use has a wrong time set. Can I set
>         the sent-time
>          > through the headers so I take my web-servers time? and how then?
>          > > Thankfull for help.
>          > >
>          > > /Kalle
>          >
>          >
>          > --
>          > PHP General Mailing List (http://www.php.net/)
>          > To unsubscribe, visit: http://www.php.net/unsub.php
>          >
> 
>         K E I T H  V A N C E
>         Web Developer, IT Professional
>         http://www.vanceconsulting.net
>         [EMAIL PROTECTED]
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to