Autor Zpráva
Horacy
Profil *
Vážení !!! Chtěl jsem udělat formulář, tak jsem si stáhnul ze stahuj.cz návod jak na to. Na své doméně mi normálně funguje, nicméně chtěl jsem ho spustit i na facebooku na stránce fbml - na facebookové stránce, vím totiž že formuláře tam udělat opravdu lze (fungující formuláře.

Ted to vypadá tak, že formulář je sice vytvořen, ale data mi neodesíla a objevuje se mi hláška ILLEGAL EXECUTION DETECTED!. Všechny cesty k souborům jsem dal přes internetový odkaz, tak tomu nějak nerozumím. v souboru form2mail.php je uvedeno :

if (!mail($MailToAddress, $MailSubject, $mailMessage,$mailHeader)) { echo "Error sending e-mail!";}
    else { header("Location: ".$redirectURL); }    
} else { echo "<center><font face=verdana size=3 color=red><b>ILLEGAL EXECUTION DETECTED!</b></font></center>";}

já jen ted nevím, jak tomu mám rozumět. Zkusil jsem smazat právě tyto 3 řádky, ale pak se mi pro změnu objevilo
Parse error: syntax error, unexpected $end in /home/httpd2/konieczny.cz/formularz/form2mail.php on line 137

Nevím, jak to ám z toho vyčíst, aby mi formulář vedený na facebooku fungoval. Porsssím moc o radu !! Revanžuji se !
Str4wberry
Profil
Zkrátka se nesplní podmínka, kterou jsi zde neuvedl, která je před tou, kterou jsi uvedl.
Horacy
Profil *
Nějak tomu nerozumím, takhle je to komplet :

<?php
# You can use this script to submit your forms or to receive orders by email.
$MailToAddress = "vzkazyzfb@email.cz"; // your email address
$redirectURL = "http://www.konieczny.cz"; // the URL of the thank you page.
$MailSubject = "[předmět emailu]"; // the subject of the email
$sendHTML = FALSE; //set to "false" to receive Plain TEXT e-mail
$serverCheck = TRUE; // if, for some reason you can't send e-mails, set this to "false"

# copyright 2006 Web4Future.com =================== READ THIS ===================================================

# If you are asking for a name and an email address in your form, you can name the input fields "name" and "email".
# If you do this, the message will apear to come from that email address and you can simply click the reply button to answer it.

# To block an IP, simply add it to the blockip.txt text file.
# CHMOD 777 the blockip.txt file (run "CHMOD 777 blockip.txt", without the double quotes)
# This is needed because the script tries to block the IP that tried to hack it

# If you have a multiple selection box or multiple checkboxes, you MUST name the multiple list box or checkbox as "name[]" instead of just "name"
# you must also add "multiple" at the end of the tag like this: <select name="myselectname[]" multiple>
# you have to do the same with checkboxes

/*****************************************************************

Web4Future Easiest Form2Mail (GPL).
Copyright (C) 1998-2006 Web4Future.com All Rights Reserved.
http://www.Web4Future.com/
This script was written by George L. & Calin S. from Web4Future.com

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

*****************************************************************/

# DO NOT EDIT BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING ===================================================
$w4fver = "2.2";
$ip = ($_SERVER['HTTP_X_FORWARDED_FOR'] == "" ? $_SERVER['REMOTE_ADDR'] : $_SERVER['HTTP_X_FORWARDED_FOR']);
//function blockIP
function blockip($ip) {
$handle = @fopen("http://formularz.konieczny.cz/blockip.txt", 'a');
@fwrite($handle, $ip."\n");
@fclose($handle);
}
$w4fx = stristr(file_get_contents('http://formularz.konieczny.cz/blockip.txt'),getenv('REMOTE_ADDR'));
if ($serverCheck) {
if (preg_match ("/".str_replace("www.", "", $_SERVER["SERVER_NAME"])."/i", $_SERVER["HTTP_REFERER"])) { $w4fy = TRUE; } else { $w4fy = FALSE; }
} else { $w4fy = TRUE; }
if (($w4fy === TRUE) && ($w4fx === FALSE)) {
$w4fMessage = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\"><html>\n<head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"></head><body><font face=3Dverdana size=3D2>";
if (count($_GET) >0) {
reset($_GET);
while(list($key, $val) = each($_GET)) {
$GLOBALS[$key] = $val;
if (is_array($val)) {
$w4fMessage .= "<b>$key:</b> ";
foreach ($val as $vala) {
$vala =stripslashes($vala);
$vala = htmlspecialchars($vala);
if (trim($vala)) { if (stristr($vala,"Content-Type:") || stristr($vala,"MIME-Version") || stristr($vala,"Content-Transfer-Encoding") || stristr($vala,"bcc:")) { blockip($ip); die("ILLEGAL EXECUTION DETECTED!"); } }
$w4fMessage .= "$vala, ";
}
$w4fMessage .= "<br>\n";
}
else {
$val = stripslashes($val);
if (trim($val)) { if (stristr($val,"Content-Type:") || stristr($val,"MIME-Version") || stristr($val,"Content-Transfer-Encoding") || stristr($val,"bcc:")) { blockip($ip); die("ILLEGAL EXECUTION DETECTED!"); } }
if (($key == "Submit") || ($key == "submit")) { }
else { if ($val == "") { $w4fMessage .= "$key: - <br>\n"; }
else { $w4fMessage .= "<b>$key:</b> $val<br>\n"; }
}
}
} // end while
}//end if
else {
reset($_POST);
while(list($key, $val) = each($_POST)) {
$GLOBALS[$key] = $val;
if (is_array($val)) {
$w4fMessage .= "<b>$key:</b> ";
foreach ($val as $vala) {
$vala =stripslashes($vala);
$vala = htmlspecialchars($vala);
if (trim($vala)) { if (stristr($vala,"Content-Type:") || stristr($vala,"MIME-Version") || stristr($vala,"Content-Transfer-Encoding") || stristr($vala,"bcc:")) {blockip($ip); die("ILLEGAL EXECUTION DETECTED!"); } }
$w4fMessage .= "$vala, ";
}
$w4fMessage .= "<br>\n";
}
else {
$val = stripslashes($val);
if (trim($val)) { if (stristr($val,"Content-Type:") || stristr($val,"MIME-Version") || stristr($val,"Content-Transfer-Encoding") || stristr($val,"bcc:")) {blockip($ip); die("ILLEGAL EXECUTION DETECTED!"); } }
if (($key == "Submit") || ($key == "submit")) { }
else { if ($val == "") { $w4fMessage .= "$key: - <br>\n"; }
else { $w4fMessage .= "<b>$key:</b> $val<br>\n"; }
}
}
} // end while
}//end else
$w4fMessage .= "<font size=3D1><br><br>\n Sender IP: ".$ip."</font></font></body></html>";
$w4f_what = array("/To:/i", "/Cc:/i", "/Bcc:/i","/Content-Type:/i","/\n/");
$name = preg_replace($w4f_what, "", $name);
$email = preg_replace($w4f_what, "", $email);
if (!$email) {$email = $MailToAddress;}
$mailHeader = "From: $name <$email>\r\n";
$mailHeader .= "Reply-To: $name <$email>\r\n";
$mailHeader .= "Message-ID: <". md5(rand()."".time()) ."@". ereg_replace("www.","",$_SERVER["SERVER_NAME"]) .">\r\n";
$mailHeader .= "MIME-Version: 1.0\r\n";
if ($sendHTML) {
$mailHeader .= "Content-Type: multipart/alternative;";
$mailHeader .= " boundary=\"----=_NextPart_000_000E_01C5256B.0AEFE730\"\r\n";
}
$mailHeader .= "X-Priority: 3\r\n";
$mailHeader .= "X-Mailer: PHP/" . phpversion()."\r\n";
$mailHeader .= "X-MimeOLE: Produced By Web4Future Easiest Form2Mail $w4fver\r\n";
if ($sendHTML) {
$mailMessage = "This is a multi-part message in MIME format.\r\n\r\n";
$mailMessage .= "------=_NextPart_000_000E_01C5256B.0AEFE730\r\n";
$mailMessage .= "Content-Type: text/plain; charset=\"UTF-8\"\r\nContent-Transfer-Encoding: quoted-printable\r\n\r\n";
$mailMessage .= trim(strip_tags($w4fMessage))."\r\n\r\n";
$mailMessage .= "------=_NextPart_000_000E_01C5256B.0AEFE730\r\n";
$mailMessage .= "Content-Type: text/html; charset=\"UTF-8\"\r\nContent-Transfer-Encoding: quoted-printable\r\n\r\n";
$mailMessage .= "$w4fMessage\r\n\r\n";
$mailMessage .= "------=_NextPart_000_000E_01C5256B.0AEFE730--\r\n";
}
if ($sendHTML === FALSE) {
$mailHeader .= "Content-Type: text/plain; charset=\"UTF-8\"\r\nContent-Transfer-Encoding: quoted-printable\r\n\r\n";
$mailMessage .= trim(strip_tags($w4fMessage))."\r\n\r\n";
}


?>
Horacy
Profil *
Omlouvám se: chyběl tam ten poslední řádek, takhle je to komplet...........prosím moc moc po pomoc :

<?php
# You can use this script to submit your forms or to receive orders by email.
$MailToAddress = "vzkazyzfb@email.cz"; // your email address
$redirectURL = "http://www.konieczny.cz"; // the URL of the thank you page.
$MailSubject = "[předmět emailu]"; // the subject of the email
$sendHTML = FALSE; //set to "false" to receive Plain TEXT e-mail
$serverCheck = TRUE; // if, for some reason you can't send e-mails, set this to "false"

# copyright 2006 Web4Future.com =================== READ THIS ===================================================

# If you are asking for a name and an email address in your form, you can name the input fields "name" and "email".
# If you do this, the message will apear to come from that email address and you can simply click the reply button to answer it.

# To block an IP, simply add it to the blockip.txt text file.
# CHMOD 777 the blockip.txt file (run "CHMOD 777 blockip.txt", without the double quotes)
# This is needed because the script tries to block the IP that tried to hack it

# If you have a multiple selection box or multiple checkboxes, you MUST name the multiple list box or checkbox as "name[]" instead of just "name"
# you must also add "multiple" at the end of the tag like this: <select name="myselectname[]" multiple>
# you have to do the same with checkboxes

/*****************************************************************

Web4Future Easiest Form2Mail (GPL).
Copyright (C) 1998-2006 Web4Future.com All Rights Reserved.
http://www.Web4Future.com/
This script was written by George L. & Calin S. from Web4Future.com

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

*****************************************************************/

# DO NOT EDIT BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING ===================================================
$w4fver = "2.2";
$ip = ($_SERVER['HTTP_X_FORWARDED_FOR'] == "" ? $_SERVER['REMOTE_ADDR'] : $_SERVER['HTTP_X_FORWARDED_FOR']);
//function blockIP
function blockip($ip) {
$handle = @fopen("http://formularz.konieczny.cz/blockip.txt", 'a');
@fwrite($handle, $ip."\n");
@fclose($handle);
}
$w4fx = stristr(file_get_contents('http://formularz.konieczny.cz/blockip.txt'),getenv('REMOTE_ADDR'));
if ($serverCheck) {
if (preg_match ("/".str_replace("www.", "", $_SERVER["SERVER_NAME"])."/i", $_SERVER["HTTP_REFERER"])) { $w4fy = TRUE; } else { $w4fy = FALSE; }
} else { $w4fy = TRUE; }
if (($w4fy === TRUE) && ($w4fx === FALSE)) {
$w4fMessage = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\"><html>\n<head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"></head><body><font face=3Dverdana size=3D2>";
if (count($_GET) >0) {
reset($_GET);
while(list($key, $val) = each($_GET)) {
$GLOBALS[$key] = $val;
if (is_array($val)) {
$w4fMessage .= "<b>$key:</b> ";
foreach ($val as $vala) {
$vala =stripslashes($vala);
$vala = htmlspecialchars($vala);
if (trim($vala)) { if (stristr($vala,"Content-Type:") || stristr($vala,"MIME-Version") || stristr($vala,"Content-Transfer-Encoding") || stristr($vala,"bcc:")) { blockip($ip); die("ILLEGAL EXECUTION DETECTED!"); } }
$w4fMessage .= "$vala, ";
}
$w4fMessage .= "<br>\n";
}
else {
$val = stripslashes($val);
if (trim($val)) { if (stristr($val,"Content-Type:") || stristr($val,"MIME-Version") || stristr($val,"Content-Transfer-Encoding") || stristr($val,"bcc:")) { blockip($ip); die("ILLEGAL EXECUTION DETECTED!"); } }
if (($key == "Submit") || ($key == "submit")) { }
else { if ($val == "") { $w4fMessage .= "$key: - <br>\n"; }
else { $w4fMessage .= "<b>$key:</b> $val<br>\n"; }
}
}
} // end while
}//end if
else {
reset($_POST);
while(list($key, $val) = each($_POST)) {
$GLOBALS[$key] = $val;
if (is_array($val)) {
$w4fMessage .= "<b>$key:</b> ";
foreach ($val as $vala) {
$vala =stripslashes($vala);
$vala = htmlspecialchars($vala);
if (trim($vala)) { if (stristr($vala,"Content-Type:") || stristr($vala,"MIME-Version") || stristr($vala,"Content-Transfer-Encoding") || stristr($vala,"bcc:")) {blockip($ip); die("ILLEGAL EXECUTION DETECTED!"); } }
$w4fMessage .= "$vala, ";
}
$w4fMessage .= "<br>\n";
}
else {
$val = stripslashes($val);
if (trim($val)) { if (stristr($val,"Content-Type:") || stristr($val,"MIME-Version") || stristr($val,"Content-Transfer-Encoding") || stristr($val,"bcc:")) {blockip($ip); die("ILLEGAL EXECUTION DETECTED!"); } }
if (($key == "Submit") || ($key == "submit")) { }
else { if ($val == "") { $w4fMessage .= "$key: - <br>\n"; }
else { $w4fMessage .= "<b>$key:</b> $val<br>\n"; }
}
}
} // end while
}//end else
$w4fMessage .= "<font size=3D1><br><br>\n Sender IP: ".$ip."</font></font></body></html>";
$w4f_what = array("/To:/i", "/Cc:/i", "/Bcc:/i","/Content-Type:/i","/\n/");
$name = preg_replace($w4f_what, "", $name);
$email = preg_replace($w4f_what, "", $email);
if (!$email) {$email = $MailToAddress;}
$mailHeader = "From: $name <$email>\r\n";
$mailHeader .= "Reply-To: $name <$email>\r\n";
$mailHeader .= "Message-ID: <". md5(rand()."".time()) ."@". ereg_replace("www.","",$_SERVER["SERVER_NAME"]) .">\r\n";
$mailHeader .= "MIME-Version: 1.0\r\n";
if ($sendHTML) {
$mailHeader .= "Content-Type: multipart/alternative;";
$mailHeader .= " boundary=\"----=_NextPart_000_000E_01C5256B.0AEFE730\"\r\n";
}
$mailHeader .= "X-Priority: 3\r\n";
$mailHeader .= "X-Mailer: PHP/" . phpversion()."\r\n";
$mailHeader .= "X-MimeOLE: Produced By Web4Future Easiest Form2Mail $w4fver\r\n";
if ($sendHTML) {
$mailMessage = "This is a multi-part message in MIME format.\r\n\r\n";
$mailMessage .= "------=_NextPart_000_000E_01C5256B.0AEFE730\r\n";
$mailMessage .= "Content-Type: text/plain; charset=\"UTF-8\"\r\nContent-Transfer-Encoding: quoted-printable\r\n\r\n";
$mailMessage .= trim(strip_tags($w4fMessage))."\r\n\r\n";
$mailMessage .= "------=_NextPart_000_000E_01C5256B.0AEFE730\r\n";
$mailMessage .= "Content-Type: text/html; charset=\"UTF-8\"\r\nContent-Transfer-Encoding: quoted-printable\r\n\r\n";
$mailMessage .= "$w4fMessage\r\n\r\n";
$mailMessage .= "------=_NextPart_000_000E_01C5256B.0AEFE730--\r\n";
}
if ($sendHTML === FALSE) {
$mailHeader .= "Content-Type: text/plain; charset=\"UTF-8\"\r\nContent-Transfer-Encoding: quoted-printable\r\n\r\n";
$mailMessage .= trim(strip_tags($w4fMessage))."\r\n\r\n";
}

if (!mail($MailToAddress, $MailSubject, $mailMessage,$mailHeader)) { echo "Error sending e-mail!";}
else { header("Location: ".$redirectURL); }
} else { echo "<center><font face=verdana size=3 color=red><b>ILLEGAL EXECUTION DETECTED!</b></font></center>";}
?>
Horacy
Profil *
Přemýšlím - pokud mi formulář normálně funguje na svých html stránkách, ale na facebookových stránkách všechno se zdá být oka, jjen když se formulář odešle, tak sice se to přesměruje na form2meil, ale objeví se hláška ILLEGAL EXECUTION........přemýšlím tedy, v čem je problém, že to na FB nejde......... došel jsem závěru, že to nemůže identifikovat IP adresu, tak jsem se ted snažil ji smazat v FORM2MEIL - možná to neumělo prostě na facebooku zjistit IP adresu, ale tím to asi taky není
Horacy
Profil *
Sedím u toho už celý den a pořád to nechápu, fakt někdo nemáte potuchy ?

Vaše odpověď


Prosím používejte diakritiku a interpunkci.

Ochrana proti spamu. Napište prosím číslo dvě-sta čtyřicet-sedm:

0