🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

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

#169591
From: Lemat
Date: Sun, 21 Feb 2016 11:23
81 lines
3117 bytes
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
Technical Details
Message-ID: <56c99e2c$0$645$65785112@news.neostrada.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!agh.edu.pl!news.agh.edu.pl!newsfeed2.atman.pl!newsfeed.atman.pl!goblin1!goblin.stu.neva.ru!newsfeed.neostrada.pl!unt-exc-01.news.neostrada.pl!unt-spo-a-02.news.neostrada.pl!news.neostrada.pl.POSTED!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>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!agh.edu.pl!news.agh.edu.pl!newsfeed2.atman.pl!newsfeed.atman.pl!goblin1!goblin.stu.neva.ru!newsfeed.neostrada.pl!unt-exc-01.news.neostrada.pl!unt-spo-a-02.news.neostrada.pl!news.neostrada.pl.POSTED!not-for-mail
Subject: Re: Sendformmail.php nie wysyła maili (po
 aktualizacji php na serwerze)
Newsgroups: pl.comp.lang.php
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>
From: Lemat <#@lemat.priv.pl>
Date: Sun, 21 Feb 2016 12:23:28 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1
MIME-Version: 1.0
In-Reply-To: <2c6b9f7d-df83-45a6-a651-38541cf26d83@googlegroups.com>
Lines: 81
Message-ID: <56c99e2c$0$645$65785112@news.neostrada.pl>
Organization: Telekomunikacja Polska
NNTP-Posting-Host: 79.189.200.118
X-Trace: 1456053805 unt-rea-b-01.news.neostrada.pl 645 79.189.200.118:53667
X-Complaints-To: abuse@news.neostrada.pl
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit