mail form -douleuei alla den steleni ta stoixia tou xristi!

Σε αυτή την περιοχή μπορείτε να βρείτε ή να αναζητήσετε πληροφορίες σχετικές με την PHP

Συντονιστές: WebDev Moderators, Super-Moderators, PHP Moderators

Απάντηση
kokaki
Δημοσιεύσεις: 39
Εγγραφή: 07 Ιουν 2005 12:52

mail form -douleuei alla den steleni ta stoixia tou xristi!

Δημοσίευση από kokaki » 25 Αύγ 2005 14:48

Exw to eksis problima enw deixei oti douleuei, stelni diladi to mail bgazei ta parakatw errors... paidia xreiazomai epigontos mia lusi!!

Κώδικας: Επιλογή όλων


Notice: Undefined variable: visitormail in c:\program files\easyphp1-8\www\test\sendeail.php on line 16
Use Back - fill in all fields

Notice: Undefined variable: badinput in c:\program files\easyphp1-8\www\test\sendeail.php on line 24

Notice: Undefined variable: attn in c:\program files\easyphp1-8\www\test\sendeail.php on line 28

Notice: Undefined variable: ccopy in c:\program files\easyphp1-8\www\test\sendeail.php on line 28

Notice: Undefined variable: notes in c:\program files\easyphp1-8\www\test\sendeail.php on line 31

Notice: Undefined variable: visitor in c:\program files\easyphp1-8\www\test\sendeail.php on line 36

Notice: Undefined variable: visitormail in c:\program files\easyphp1-8\www\test\sendeail.php on line 36

Notice: Undefined variable: ip in c:\program files\easyphp1-8\www\test\sendeail.php on line 37

Notice: Undefined variable: httpagent in c:\program files\easyphp1-8\www\test\sendeail.php on line 38

Notice: Undefined variable: httpref in c:\program files\easyphp1-8\www\test\sendeail.php on line 39

Notice: Undefined variable: visitormail in c:\program files\easyphp1-8\www\test\sendeail.php on line 42

Notice: Undefined variable: ccopy in c:\program files\easyphp1-8\www\test\sendeail.php on line 44

Date: Thursday, August 25, 2005, 1:29 pm
Thank You :
Notice: Undefined variable: visitor in c:\program files\easyphp1-8\www\test\sendeail.php on line 58
(
Notice: Undefined variable: visitormail in c:\program files\easyphp1-8\www\test\sendeail.php on line 58
)
Attention: ()
Message:


Notice: Undefined variable: ip in c:\program files\easyphp1-8\www\test\sendeail.php on line 67


Next Page 


kai auto pou pernw sto mail mou einai

Κώδικας: Επιλογή όλων

From :  mpla@hotmail.com
Sent :  Thursday, August 25, 2005 2:03 PM 
To :  mpla@hotmail.com 
Subject :  () 
  
------------- sto message-------
 
 
 Thursday, August 25, 2005, 1:03 pm [EST] 

Attention: () 

Message:  

From:  ()

Additional Info : IP =  

Browser Info:  

Referral :  


-------------------

O kodikas einai :


form page:

Κώδικας: Επιλογή όλων


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http&#58;//www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Email Form </title>
</head>
<body>

<form method="post" action="sendeail.php">

<!-- DO NOT change ANY of the php sections -->
<?php
$ipi = getenv&#40;"REMOTE_ADDR"&#41;;
$httprefi = getenv &#40;"HTTP_REFERER"&#41;;
$httpagenti = getenv &#40;"HTTP_USER_AGENT"&#41;;
?>

<input type="hidden" name="ip" value="<?php echo $ipi ?>" />
<input type="hidden" name="httpref" value="<?php echo $httprefi ?>" />
<input type="hidden" name="httpagent" value="<?php echo $httpagenti ?>" />


Your Name&#58; <br />
<input type="text" name="visitor" size="35" />
<br />
Your Email&#58;<br />
<input type="text" name="visitormail" size="35" />
<br /> <br />
Copy Sender ? No<input name="ccopy" type="radio" value="ccno" /> Yes<input checked="checked" name="ccopy" type="radio" value="ccyes" /> <br />

<br />
Attention&#58;<br />
<select name="attn" size="1">
<option value=" Sales n Billing ">Sales n Billing </option>
<option value=" General Support ">General Support </option>
<option value=" Technical Support ">Technical Support </option>
<option value=" Webmaster ">Webmaster </option>
</select>
<br /><br />
Mail Message&#58;
<br />
<textarea name="notes" rows="4" cols="40"></textarea>
<br />
<input type="submit" value="Send Mail" />
<br />
Free Code at&#58; <a href="http&#58;//www.ibdhost.com/contact/">ibdhost.com/contact/</a>
</form>

</body>
</html>

sendmail page:

Κώδικας: Επιλογή όλων

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http&#58;//www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Sendemail Script</title>
</head>
<body>

<!-- Required&#58; YOUR email &#40;$myemail&#41;. Optional&#58; Enter CC email address &#40;$ccx&#41;
Required&#58; Add the link for the 'next page' &#40;at the bottom&#41; -->

<?php
$myemail = "email_here";
$ccx = "";

if&#40;!$visitormail == "" && &#40;!strstr&#40;$visitormail,"@"&#41; || !strstr&#40;$visitormail,"."&#41;&#41;&#41;
&#123;
echo "<h2>Use Back - Enter valid e-mail</h2>\n";
$badinput = "<h2>Feedback was NOT submitted</h2>\n";
&#125;
if&#40;empty&#40;$visitor&#41; || empty&#40;$visitormail&#41; || empty&#40;$notes &#41;&#41; &#123;
echo "<h2>Use Back - fill in all fields</h2>\n";
&#125;
echo $badinput;

$todayis = date&#40;"l, F j, Y, g&#58;i a"&#41; ;

$attn = $attn . "&#40;" . $ccopy . "&#41;" ;
$subject = $attn;

$notes = stripcslashes&#40;$notes&#41;;

$message = " $todayis &#91;EST&#93; \n
Attention&#58; $attn \n
Message&#58; $notes \n
From&#58; $visitor &#40;$visitormail&#41;\n
Additional Info &#58; IP = $ip \n
Browser Info&#58; $httpagent \n
Referral &#58; $httpref \n
";

$from = "From&#58; $visitormail\r\n";

if &#40;&#40;$ccopy == "ccyes"&#41; && &#40;$visitormail != ""&#41;&#41;
mail&#40;$visitormail, $subject, $message, $from&#41;;

if &#40;$myemail != ""&#41;
mail&#40;$myemail, $subject, $message, $from&#41;;

if &#40;$ccx != ""&#41;
mail&#40;$ccx, $subject, $message, $from&#41;;

?>

<p align="center">
Date&#58; <?php echo $todayis ?>
<br />
Thank You &#58; <?php echo $visitor ?> &#40; <?php echo $visitormail ?> &#41;
<br />

Attention&#58; <?php echo $attn ?>
<br />
Message&#58;<br />
<?php $notesout = str_replace&#40;"\r", "<br/>", $notes&#41;;
echo $notesout; ?>
<br />
<?php echo $ip ?>

<br /><br />
<a href="cc_form.php"> Next Page </a>
</p>

</body>
</html>

E :roll:

Άβαταρ μέλους
xultimatex
Honorary Member
Δημοσιεύσεις: 2505
Εγγραφή: 26 Ιούλ 2003 13:02
Τοποθεσία: Ξάνθη
Επικοινωνία:

mail form -douleuei alla den steleni ta stoixia tou xristi!

Δημοσίευση από xultimatex » 25 Αύγ 2005 15:52

Κάπου, αντι για stripslashes γράφει stripcslashes.

Δε βλέπω πουθενά να τραβάς τις μεταβλητές της φόρμας από τον πίνακα $_POST. Αυτό μπορεί να γίνει αυτόματα αν αλλάξεις την τιμή μιας μεταβλητής από το php.ini (δε θυμάμαι ακριβώς). Με προβληματίζει όμως που λες ότι στέλνει το email :-?
:arrow: Αν προσπαθείς πολύ για να πετύχεις κάτι, ίσως το κάνεις με λάθος τρόπο...

kokaki
Δημοσιεύσεις: 39
Εγγραφή: 07 Ιουν 2005 12:52

mail form -douleuei alla den steleni ta stoixia tou xristi!

Δημοσίευση από kokaki » 26 Αύγ 2005 10:25

eyxaristw katarxin xultimatex alla mipws mporeis na mou peis me pio tropo trabas tis metablites apo to post?
Kai mia erotisi akoma o kodikas mou einai sostos? :roll:

freds
Δημοσιεύσεις: 320
Εγγραφή: 24 Φεβ 2005 16:11

mail form -douleuei alla den steleni ta stoixia tou xristi!

Δημοσίευση από freds » 26 Αύγ 2005 11:44

O tropos va trabas tis metablites einai o parakato $visitor=$HTTP_POST_VARS['visitor'];

Kane to idio kai me tis alles metavlites. Tha prostheseis auton ton kodika stin selida sendmail.php

Άβαταρ μέλους
Rapid-eraser
WebDev Moderator
Δημοσιεύσεις: 6851
Εγγραφή: 05 Απρ 2003 17:50
Τοποθεσία: Πειραιάς
Επικοινωνία:

mail form -douleuei alla den steleni ta stoixia tou xristi!

Δημοσίευση από Rapid-eraser » 26 Αύγ 2005 12:02

kalitera va ta kavei meso tou method pou erxovte $_POST n $_GET
Cu, Rapid-eraser, Tα αγαθά copies κτώνται.
Love is like oxygen, You get too much you get too high
Not enough and you're gonna die, Love gets you high

freds
Δημοσιεύσεις: 320
Εγγραφή: 24 Φεβ 2005 16:11

mail form -douleuei alla den steleni ta stoixia tou xristi!

Δημοσίευση από freds » 26 Αύγ 2005 12:15

Έχει μεγάλη διαφορά η $HTTP_POST_VARS από την $_POST και ποιά;

kokaki
Δημοσιεύσεις: 39
Εγγραφή: 07 Ιουν 2005 12:52

mail form -douleuei alla den steleni ta stoixia tou xristi!

Δημοσίευση από kokaki » 26 Αύγ 2005 12:43

Paidia to kserw oti mporei ginomai kourastiki alla den mou douleuei oute etsi mporeis kapios namou dosei ena pio analutiko paradeigma mipws kano kati lathos??!!!

Άβαταρ μέλους
Rapid-eraser
WebDev Moderator
Δημοσιεύσεις: 6851
Εγγραφή: 05 Απρ 2003 17:50
Τοποθεσία: Πειραιάς
Επικοινωνία:

mail form -douleuei alla den steleni ta stoixia tou xristi!

Δημοσίευση από Rapid-eraser » 26 Αύγ 2005 12:54

to $HTTP_POST_VARS eivai depricated apo tnv 4.1.0 kai pavo
Cu, Rapid-eraser, Tα αγαθά copies κτώνται.
Love is like oxygen, You get too much you get too high
Not enough and you're gonna die, Love gets you high

Άβαταρ μέλους
apoel
Δημοσιεύσεις: 350
Εγγραφή: 18 Ιούλ 2005 23:46
Επικοινωνία:

mail form -douleuei alla den steleni ta stoixia tou xristi!

Δημοσίευση από apoel » 10 Σεπ 2005 17:49

aftos ine o kodikos pou thelis kane tis kataliles allages sto deftero meros gia ta email kai afta ke ise etimos.




simple_form.html
<html>
<head>
<title>Email Form</title>
</head>
<body>
<form method="post" action="sendeail.php">
<p><strong>Your Name:</strong><br>
<input type="text" name="sender_name" size=30></p>
<p><strong>Your E-Mail address:</strong><br>
<input type="text" name="sender_email" size=30></P>
<p><strong>Attention:</strong><br>
<select name="attn" size="1">
<option value=" Sales n Billing ">Sales n Billing </option>
<option value=" General Support ">General Support </option>
<option value=" Technical Support ">Technical Support </option>
<option value=" Webmaster ">Webmaster </option>
</select>
<br /><br />
<p><strong>Message:</strong><br>
<textarea name="message" cols=30 rows=5 wrap=virtual></textarea></p>
<input type="submit" value="Send this form">
</form>
</body>
</html>
send_simpleform.php
<?
if (($_post[sender_name] == "") ||
($_post[sender_email] == "") ||
($_post[message] == "")) {
header("Location: simple_form.html");
exit;
}
$msg = "E-MAIL SENTT FROM WWW SITE\n";
$msg .= "Sender's Name:\t$_POST[sender_name]\n"
$msg .="Attention:\t$_POST[attn]\n"
$msg .= "Sender's E-mail:\t$_Post{sender_email]\n";
$msg .= "Message:\t$_POST[message]\n";
$to = "you@youremail.com";
$subject = "Web Site Feedback";
$mailheaders = "From: My Web Site <genericaddress@yourdomain.com>\n";
$mailheaders .= "Reply-To: $_POST[sender_email]\n";
mail($to, $subject, $msg, $mailheaders);
?>
<html>
<head>
<title>Success</title>
</head>
<body>
<H1>The following e-mail has been sent:<H1>
<p><strong>Your Name:</strong><br>
<? echo "$_POST[sender_name]";?>
<p><strong>Your E-Mail address:</strong><br>
<? echo "$_POST[sender_email]"; ?>
<p><strong>attention:</strong><br>
<? echo "$_POST[attn]"; ?>
<P><strong>Message:</strong><br>
<? echo "$_POST[message]"; ?>
</body>
</html>

Απάντηση

Επιστροφή στο “PHP Προγραμματισμός”

Μέλη σε σύνδεση

Μέλη σε αυτήν τη Δ. Συζήτηση: Δεν υπάρχουν εγγεγραμμένα μέλη και 0 επισκέπτες