Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php] Klikając email wstawiasz go do formularza?
lagos
post
Post #1





Grupa: Zarejestrowani
Postów: 21
Pomógł: 0
Dołączył: 7.06.2009

Ostrzeżenie: (0%)
-----


Klikając e mail wstawiasz go do formularza?
Chodzi mi o coś takiego.
Kliknięcie w mail otwiera okno z formularzem i automatycznie wczytuje email w miejsce gdzie ma być wysłany.
Nie chodzi o otwarcie domyślnego programu pocztowego coś takiego posiadam.
Czy ktoś spotkał się z taką możliwością.
Pozdrawiam
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
tadek92
post
Post #2





Grupa: Zarejestrowani
Postów: 108
Pomógł: 3
Dołączył: 26.07.2008

Ostrzeżenie: (0%)
-----


Mam podobny skrypt na mojej stronie jak chcesz możesz z niego skorzystać (IMG:http://forum.php.pl/style_emoticons/default/snitch.gif)

plik z formularzem kontaktowym (w moim przepadku contact.php):
Kod
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
   <head>
   <title>Formularz kontaktowy</title>
   </head>
   <body>
     <?php
$tresc="$_POST[tresc]
  $_POST[imie] ";
$head="From:<$_POST[email]>";
$head.="\nMIME-Version: 1.0\nContent-type: text/html; charset=UTF-8";
$user_email=$_GET['email'];

if (isset($_POST[ok])) {
$email=$_POST['user_email'];
mail("$email", "$_POST[temat]", "$tresc", "$head");
echo "Wiadomość została wysłana";}

else{

?>
<form style="text-align: center;" method="post" action="#">
<fieldset>
<input style="background:#FFFFFF;border:1px solid #555555;margin:3px 0 0 0; font-size:10px; font-weight:bold;" type="hidden" name="user_email" value="<?php echo "$user_email"; ?>"/>
Temat:
<input style="background:#FFFFFF;border:1px solid #555555;margin:3px 0 0 0; font-size:10px; font-weight:bold;" type="text" name="temat" size="33"  />
  
Podaj e-mail:
  <input style="background:#FFFFFF;border:1px solid #555555;margin:3px 0 0 0; font-size:10px; font-weight:bold;" type="text" name="email" size="33"  />
  
Podaj imię i nazwisko:
  <input style="background:#FFFFFF;border:1px solid #555555;margin:3px 0 0 0; font-size:10px; font-weight:bold;" type="text" name="imie" size="33"  />
  
Treść:
  <textarea style="background:#FFFFFF;border:1px solid #555555;margin:3px 0 0 0; font-size:12px; font-weight:bold;" name="tresc" cols="25" rows="7" ></textarea>
  
<input style="background:#FFFFFF;border:1px solid #555555;margin:3px 0 0 0; font-size:10px; font-weight:bold;" type="submit" value="Wyślij" name="ok" />
</fieldset>
</form>
<?php } ?>
</body>
</html>

na stronie na której jest link z mailem w sekcji head dajesz:
Kod
   <script type="text/javascript">
    <!--
function externalLinks()
{
if (!document.getElementsByTagName) return;

var anchors = document.getElementsByTagName("a");
for (var i=0; i<anchors.length; i++) {
var anchor = anchors[i];
var relvalue = anchor.getAttribute("rel");

if (anchor.getAttribute("href")) {
var external = /external/;
var relvalue = anchor.getAttribute("rel");
if (external.test(relvalue)) { anchor.target = "_blank"; }
}
}
}
window.onload = externalLinks;
//-->
</script>
   <script type="text/javascript">
   <!--
   function displayWindow(url, width, height) {
         var Win = window.open(url,"displayWindow",'width=' + width + ',height=' + height +       ',resizable=0,scrollbars=yes,menubar=no, left=350,top=250' );
   }
   //-->
   </script>

a tak wygląda link:
Kod
<a href=\"javascript:displayWindow('contact.php?email=adres@mail.pl',250,335)\">adres@mail.pl</a>
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 5.10.2025 - 00:23