Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]Session - problem z wysyłanie maila
kleszcz12
post
Post #1





Grupa: Zarejestrowani
Postów: 102
Pomógł: 0
Dołączył: 16.03.2008

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


witam, mam problem , mianowicie skrypt nioe chce wysyłać maila...

rejestrator.php
  1. <form method="post" action="rejestrator2.php">
  2. <input type="text" name="login"> - Login<br>
  3. <input type="password" name="haslo"> - Haslo<br>
  4. <input type="password" name="haslo2"> - Potwierdz haslo<br>
  5. <input type="text" name="mail"> - Email<br>
  6. <input type="submit" value="rejestruj!">
  7. </form>


rejestrator2.php:
  1. <?
  2.  
  3.  
  4.  
  5.  
  6. $login = $_POST['login'];
  7. $haslo = $_POST['haslo'];
  8. $haslo2 = $_POST['haslo2'];
  9. $mail = $_POST['mail'];
  10. $file = ("users/$login.txt");
  11. if(file_exists($file)):
  12. echo("Ten login jest juz zajety!");
  13. elseif($haslo != $haslo2):
  14. echo("Podales dwa rozne hasla!");
  15. else:
  16. $ciag = "$login:$haslo:$mail";
  17. $zapis = str_replace("$ "," $",$ciag);
  18. $open = fopen("$file", "w+");
  19. fputs($open, $zapis);
  20. fclose($open);
  21. echo header("Location: rejestracjapomyslna.php");
  22. endif;
  23.  
  24.  
  25. $_SESSION['mail'] = $_POST['mail'];
  26. echo 'przed:'. $_SESSION['mail'];
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33. ?>


rejestracjapomyslna.php
  1. <?php
  2.  
  3. echo 'przed: '.$_SESSION['mail'].'<br>';
  4. $_SESSION['mail'] = $_POST['mail'];
  5. ?>
  6.  
  7.  
  8.  
  9.  
  10. <?php 
  11. $email_do = $_SESSION['mail']; 
  12. $email_temat = "Mail testowy";
  13. $email_wiadomosc = "Tutaj treść wiadomości \nTutaj druga linia wiadomości!";
  14. if(mail($email_do, $email_temat, $email_wiadomosc)){
  15. echo "Email (".$email_temat.") został wysłany.";
  16. } else {
  17. echo "Email (".$email_temat.") nie został wysłany.";
  18. }
  19. ?>

problem polega na tym że po przejsciu do rejestrator2 mail jest wyswielany, zresztą na rejestracjapomyslna też jest wyświetlany, jednak pojawia się Email...nie został wysłany...
pzdr

Ten post edytował kleszcz12 14.05.2008, 16:19:55
Go to the top of the page
+Quote Post

Posty w temacie


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

 



RSS Aktualny czas: 19.08.2025 - 21:37