Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [PHP] konfiguracja formularza
pluton
post
Post #1





Grupa: Zarejestrowani
Postów: 1
Pomógł: 0
Dołączył: 2.12.2007

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


Witam

Mam skrypt zawierający formularz, ale niestety nie znam się na formularzach dlatego proszę o pomoc w konfiguracji:

Mam dwa pliki:
contact.asp
contact.php

asp ma poastać:
______________________________________________________________________________
...
message=Request("message")
next
message=message + Request("message")
smtpServer = "enter your SMTP SERVER HERE"
smtpPort = 25


name = Request("Your_Name:")
Set myMail = CreateObject("CDO.Message")
myMail.Subject = "from " & name
myMail.From = Request("Your_Email:")
myMail.To = Request("recipient")
myMail.HTMLBody = "<html><head><title>Contact letter</title></head><body><br>" & message & "</body></html>"
...
______________________________________________________________________________


Natomiast PHP:
______________________________________________________________________________
...
while ($request = current($_REQUEST)) {
if (key($_REQUEST)!='recipient') {
$pre_array=split ("&777&", $request);

$post_vars[key($_REQUEST)][0]=preg_replace ("/<[^>]*>/", "", $pre_array[0]);
$post_vars[key($_REQUEST)][1]=preg_replace ("/<[^>]*>/", "", $pre_array[1]);
}
next($_REQUEST);
}



reset($post_vars);


$subject="From ".$post_vars['your_name'][0] ;
$headers= "From: ".$post_vars['your_email'][0] ."\n";
$headers.='Content-type: text/html; charset=iso-8859-1';
$message='';
while ($mess = current($post_vars)) {
if ((key($post_vars)!="i") && (key($post_vars)!="your_email") && (key($post_vars)!="your_name")) {

$message.="<strong>".$mess[1]."</strong>&nbsp;&nbsp;&nbsp;".$mess[0]."<br>";
}
next($post_vars);
}

mail($_REQUEST['recipient'], $subject, "
<html>
<head>
<title>Contact letter</title>
</head>
<body>
<br>
".$message."
</body>
</html>" , $headers);
echo ("Your message was successfully sent!");

?>

...
_________________________________________________________________________

Gdzie mam wpisać mój adres email aby po naciśnięciu Submit treść wiadomości z formularza trafiała na moją skrzynkę.
Z góry dzięki za pomoc.

Go to the top of the page
+Quote Post
NetJaro
post
Post #2





Grupa: Zarejestrowani
Postów: 475
Pomógł: 0
Dołączył: 1.04.2005
Skąd: Warszawa

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


Polecam tutaj zajrzeć.. Są tam lepsze, wyraźniejsze i łatwiejsze przykłady.
Go to the top of the page
+Quote Post
kossa
post
Post #3





Grupa: Zarejestrowani
Postów: 1 165
Pomógł: 9
Dołączył: 9.04.2002
Skąd: Toruń

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


Używaj BBCode - łatwiej będzie się czytać Twój kod.

Masz pod koniec linię: mail($_REQUEST['recipient'], $subject, "

  1. <?php
  2. $do_kogo_email="Twoj@email.pl";
  3.  
  4. mail($do_kogo_email, $subject, "
  5. ?>


Łukasz
Go to the top of the page
+Quote Post

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: 22.08.2025 - 22:52