🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.php
Article #169592

Re: Sendformmail.php nie wysyła maili (po aktualizacji php na serwerze)

#169592
From: stas13111979
Date: Sun, 21 Feb 2016 11:58
204 lines
10369 bytes
W dniu niedziela, 21 lutego 2016 03:23:27 UTC-8 użytkownik Lemat napisał:
> W dniu 21.02.2016 o 12:08, stas13111979@gmail.com pisze:
> > W dniu środa, 22 lutego 2006 10:03:49 UTC-8 użytkownik Elmo Killer napisał:
> >>> wypełnij to
> >>>
> >>> mail($email,$subject,$body);
> >>
> >>
> >> DZIĘKI!!! działa! :-)
> >
> > Mam identyczny problem ale po wypełnieniu dalej klapa. Albo coś pominąłem jeszcze w skrypcie.
> >
> > <?
> >
> > function error($error) {
> > ?>
> > 	<html>
> > 	<head>
> > 		<meta http-equiv="Content-type" content="text/html; charset=ISO-8859-2">
> > 	</head>
> > 	<body>
> > 	<? echo $error ?>
> > 	</body>
> > 	</html>
> > <?
> > 	exit;
> > }
> >
> > $email    = $_POST['email'];
> > $location = $_POST['location'];
> > $require  = $_POST['require'];
> >
> > if($email == "") {
> > 	$error = "Nie został podany adres na który ma być wysłany email z danymi z formularza.";
> > 	error($error);
> > }
> >
> > if($require != "") {
> > 	$separator = ",";
> > 	for($item = strtok($require,$separator);
> > 		$item;
> > 		$item = strtok($separator)) {
> > 			$items[$item]++;
> > 	}
> > }
> >
> > while(list($key,$val) = each($HTTP_POST_VARS)) {
> > 	if(($key != 'send') and ($key != 'email') and ($key != 'subject') and ($key != 'require') and ($key != 'location')) {
> > 		if(gettype($items) == 'array') {
> > 			reset($items);
> > 			while(list($key2,$val2) = each($items)) {
> > 				if(($key == $key2) and ($val == "")) {
> > 					$error = "Nie zostało wypełnione pole $key.";
> > 					error($error);					
> > 				}
> > 			}
> > 		}
> > 		$body .= "$key:\n$val\n\n";
> > 	}
> > }
> >
> >
> > mail($email,$subject,$body,"From: Klient internetowy <formmail@pandp.home.pl>");
> >
> > if($location == "") {
> > 	$error = "Formularz został wysłany. Dziękujemy.";
> > 	error($error);
> > } else {
> > 	header("Location: $location");
> > }
> >
> > ?>
> >
> 
> 1) Nie podałeś komunikatu błędu.
> 2) Używasz starodawnej tabeli $HTTP_POST_VARS zamiast $_POST
> 3) twój skrypt umożliwia wysyłanie emaila przez dowolną osobę do 
> dowolnej osoby? no to masz problem z bezpieczeństwem.
> 
> -- 
> Pozdrawiam
> Lemat

Przepraszam, jeśli będę męczący ale to jest powrót i ponowna gimnastyka po 12latach od ukończenia szkoły. Jak przyszło mi odświeżyć wiedzę.

Ad.1 Chodzi Ci o zmianę wyświetlającego się komunikatu ?
Ad.2 Po zmianie na $_POST dalej nic.
Ad.3 Adres nadawcy jest zdefiniowany w form.php

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//ENPL">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<link href="styl.css" rel="stylesheet" type="text/css">
<script language="JavaScript">
<!--
function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' musi zawierać znak "@"\n';
      } else if (test!='R') {
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (val<min || max<val) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- pole '+nm+' jest puste.\n'; }
  } if (errors) alert('Formularz zawiera następujące błędy:\n'+errors);
  document.MM_returnValue = (errors == '');
}
//-->
</script>
</head>

<body topmargin="0">
<table width="800" height="675" border="0" align="center" cellpadding="2" cellspacing="3" class="tekst3"><tr>
<td height="669" valign="top"><br>
<table border="0" cellspacing="3" cellpadding="2"><tr> 
<td width="100%" class="tekst3">Jeśli są Państwo zainteresowani wycieczką z Biurem Turystyki. - prosimy o wypełnienie i przesłanie nam poniższego formularza. Wypełnienie i przesłanie formularza zgłoszeniowego  na wycieczkę jest formą zawarcia umowy z Biurem Turystyki. Po otrzymaniu zgłoszenia wysłanego z tej strony, pracownik Biura prześle Państwu e-maila potwierdzającego rezerwację wraz z informacją o dalszej drodze postępowania. </td></tr>
<tr><td class="tekst2"><hr size="1" noshade></td></tr>
<tr><td> 
<form name="zgloszenie" method="POST" action="http://www.strona.pl/php/sendformmail.php3">
<input type="hidden" name="email" value="stas@it-pomoc.com">
<input type="hidden" name="location" value="http://www.strona.pl/info.php">

<table width="100%" border="0" cellpadding="3" cellspacing="0" class="tekst3"><tr> 
<td width="40%" class="tekst2"><div align="right">nazwa wycieczki</div></td>
<td width="2%"></td>
<td width="58%"> 
				  
<select name="impreza" size="1">
<option selected>-- wybierz wycieczkę --</option>
<option>Słowacja - Wyżne Rużbachy: 20 - 27.02</option>
<option>Iran: 7 - 15.03</option>
</select></td></tr>

<tr><td class="tekst2" width="40%"><div align="right">imię i nazwisko</div></td>
<td width="2%"></td>

<td width="58%"><input type="text" name="imie i nazwisko" maxlength="50" size="40"></td></tr>

<tr><td class="tekst2" width="40%"><div align="right">data urodzenia</div></td>
<td width="2%"></td>

<td width="58%"><input type="text" name="data i miejsce urodzenia" maxlength="50" size="40"></td></tr>

<tr><td class="tekst2" width="40%"> <div align="right">adres  zamieszkania</div></td>
<td width="2%"></td>

<td width="58%"> <textarea name="adres zamieszkania" cols="40" rows="3"></textarea></td></tr>

<tr><td width="40%" class="tekst2"><div align="right">e-mail</div></td><td width="2%" height="30"></td>

<td width="58%"><input name="e-mail" type="text" id="e-mail" size="30" maxlength="30"></td></tr>

<tr><td class="tekst2" width="40%"> <div align="right">numer telefonu</div></td><td width="2%" height="30"></td>

<td width="58%"> <input type="text" name="telefon" maxlength="50" size="20"></td></tr>

<tr><td width="40%" class="tekst2"><div align="right">seria i numer paszportu <br>(lub seria i numer dowodu osobistego)</div></td><td width="2%" class="tekst2"></td>

<td width="58%" class="tekst2"> <input type="text" name="seria i nr paszportu" maxlength="50" size="20"></td></tr>

<tr><td width="40%" class="tekst2"> <div align="right">data i miejsce wydania paszportu </div></td><td width="2%"></td>

<td width="58%" class="tekst2"> <input type="text" name="miejsce wydanie paszportu" maxlength="50" size="30"></td></tr>

<tr><td width="40%" class="tekst2"> <div align="right">data ważności paszportu</div></td><td width="2%"></td>

<td width="58%" class="tekst2"> <input type="text" name="data waznosci paszportu" maxlength="50" size="20"></td></tr>

<tr><td colspan="3"><hr size="1" noshade></td></tr>

<tr><td class="tekst2" colspan="3"> 
Oświadczam, że po zapoznaniu się z programem imprezy oraz <a href="index.php?go=7" class="link">WARUNKAMI UCZESTNICTWA</a>,  przyjmuję je do wiadomości i zgłaszam swój udział w wycieczce. Wyrażam zgodę na przetwarzanie moich danych osobowych przez Biuro Turystyki. dla potrzeb realizacji imprezy turystycznej oraz prowadzenia korespondencji.<br>

tak <input type="radio" name="taknie" value="radiobutton" checked>
nie <input type="radio" name="taknie" value="radiobutton"> 
</td></tr>

<tr><td width="40%" class="tekst2"> <div align="right"> Miejscowość i data</div></td>
<td width="2%" class="tekst2"></td>

<td width="58%" class="tekst2">
<input type="text" name="miejscowosc i data" maxlength="50" size="30"></td></tr>
<tr><td width="40%"><div align="right">

<input type="submit" name="Wyślij" value="Wyślij" onClick="MM_validateForm('imie i nazwisko','','R','e-mail','','R','telefon','','R');return document.MM_returnValue"></div></td>
<td width="2%"></td>

<td width="58%">
<input type="hidden" name="location" value="http://www.strona.pl/komunikat.php"> 
<input type="hidden" name="subject" value="Zgłoszenie na wycieczkę"> 
<input type="reset" name="kasuj" value="Kasuj dane"></td></tr>
<tr><td colspan="3"></td></tr></table>
</form></td></tr>

<tr><td class="tekst3">W związku z ustawą z dnia 29.08.1997 o Ochronie Danych Osobowych (Dz. U. Nr 133/97) Biuro Turystyki oświadcza że powyższe dane zostaną wprowadzone do komputerowej bazy danych Biura. Biuro Turystyki wykorzysta te dane wyłącznie w celu przesyłania katalogów i materiałów reklamowych. Klient ma prawo do wglądu do swoich danych, ich poprawiania oraz żądania ich usunięcia. Dane te nie są nigdy udostępniane osobom trzecim, z wyjątkiem sytuacji gdy wynika to z obowiązujących przepisów prawa. </td></tr></table>
</td></tr></table>

</body>
</html>
Technical Details
Message-ID: <782bf500-f440-469f-bcab-b6a341a29745@googlegroups.com>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!fu-berlin.de!news.glorb.com!hb3no7835406igb.0!news-out.google.com!kr2ni2692igb.0!nntp.google.com!hb3no7835401igb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
References: <dti7t3$5le$1@inews.gazeta.pl> <dti868$6re$1@nemesis.news.tpi.pl> <dti93u$bcs$1@inews.gazeta.pl> <2c6b9f7d-df83-45a6-a651-38541cf26d83@googlegroups.com> <56c99e2c$0$645$65785112@news.neostrada.pl>

Show Full Headers
Complete Article Headers
X-Received: by 10.182.240.137 with SMTP id wa9mr21938469obc.16.1456055919035;        Sun, 21 Feb 2016 03:58:39 -0800 (PST)
X-Received: by 10.50.155.65 with SMTP id vu1mr82894igb.0.1456055919012; Sun, 21 Feb 2016 03:58:39 -0800 (PST)
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!fu-berlin.de!news.glorb.com!hb3no7835406igb.0!news-out.google.com!kr2ni2692igb.0!nntp.google.com!hb3no7835401igb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups: pl.comp.lang.php
Date: Sun, 21 Feb 2016 03:58:38 -0800 (PST)
In-Reply-To: <56c99e2c$0$645$65785112@news.neostrada.pl>
Complaints-To: groups-abuse@google.com
Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=94.254.224.57; posting-account=QvGtMgoAAADm9Yl3b2QoK8_vZ1fdI5sa
NNTP-Posting-Host: 94.254.224.57
References: <dti7t3$5le$1@inews.gazeta.pl> <dti868$6re$1@nemesis.news.tpi.pl> <dti93u$bcs$1@inews.gazeta.pl> <2c6b9f7d-df83-45a6-a651-38541cf26d83@googlegroups.com> <56c99e2c$0$645$65785112@news.neostrada.pl>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <782bf500-f440-469f-bcab-b6a341a29745@googlegroups.com>
Subject: Re: Sendformmail.php nie wysyła maili (po
 aktualizacji php na serwerze)
From: stas13111979@gmail.com
Injection-Date: Sun, 21 Feb 2016 11:58:39 +0000
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit