Page 2 of 2

Re: Contact form

Posted: Fri Jul 19, 2019 2:29 pm
by ponton.z
I am opening a new page and the header is a message sent and below Not Found I wanted to pop up the message on this page and not on the new page

Re: Contact form

Posted: Fri Jul 19, 2019 2:37 pm
by Pablo

Re: Contact form

Posted: Fri Jul 19, 2019 3:08 pm
by ponton.z
Where should I put them on these two sides success and error

Re: Contact form

Posted: Fri Jul 19, 2019 3:55 pm
by Pablo
This does not change the way the success and error page are configured.

Please do one thing at a time.
- first make your form work
- then make the success and error page work
- next implement the popup

Re: Contact form

Posted: Fri Jul 19, 2019 4:25 pm
by ponton.z
Mam zrobiony formularz kontaktowy i pokieruj mnie krok po kroku jak uruchomić okienko informacyjne wysłane lub błąd, gdzie mam wejść i co zrobić aż to finału. Wiem ze jestem upierdliwy, ale bym v=chciał mię ta funkcje.

Re: Contact form

Posted: Fri Jul 19, 2019 4:53 pm
by Pablo

Re: Contact form

Posted: Fri Jul 19, 2019 6:17 pm
by ponton.z
I do it like a guide but it does not work.
1The page is created and the second error
2 I'm moving two files form and the other one
3 I will fill them out as in the drawing and does not work, so I asked you to show me how you do it in the drawings

Re: Contact form

Posted: Fri Jul 19, 2019 6:19 pm
by Pablo
Did you publish all files?
What is the URL of the page?
What is the HTML/PHP code of the page?

Re: Contact form

Posted: Fri Jul 19, 2019 6:45 pm
by ponton.z
yes page is osiedle-kochanowka.pl
?php
function ValidateEmail($email)
{
$pattern = '/^([0-9a-z]([-.\w]*[0-9a-z])*@(([0-9a-z])+([-\w]*[0-9a-z])*\.)+[a-z]{2,6})$/i';
return preg_match($pattern, $email);
}
if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['formid']) && $_POST['formid'] == 'wysłana-pomyślnieform1')
{
$mailto = 'yourname@yourdomain.com';
$mailfrom = isset($_POST['email']) ? $_POST['email'] : $mailto;
$subject = 'Website form';
$message = 'Values submitted from web site form:';
$success_url = './wysłana-pomyślnie.php';
$error_url = './błąd.php';
$eol = "\n";
$error = '';
$internalfields = array ("submit", "reset", "send", "filesize", "formid", "captcha_code", "recaptcha_challenge_field", "recaptcha_response_field", "g-recaptcha-response");
$boundary = md5(uniqid(time()));
$header = 'From: '.$mailfrom.$eol;
$header .= 'Reply-To: '.$mailfrom.$eol;
$header .= 'MIME-Version: 1.0'.$eol;
$header .= 'Content-Type: multipart/mixed; boundary="'.$boundary.'"'.$eol;
$header .= 'X-Mailer: PHP v'.phpversion().$eol;

try
{
if (!ValidateEmail($mailfrom))
{
$error .= "The specified email address (" . $mailfrom . ") is invalid!\n<br>";
throw new Exception($error);
}

$message .= $eol;
$message .= "IP Address : ";
$message .= $_SERVER['REMOTE_ADDR'];
$message .= $eol;
foreach ($_POST as $key => $value)
{
if (!in_array(strtolower($key), $internalfields))
{
if (!is_array($value))
{
$message .= ucwords(str_replace("_", " ", $key)) . " : " . $value . $eol;
}
else
{
$message .= ucwords(str_replace("_", " ", $key)) . " : " . implode(",", $value) . $eol;
}
}
}
$body = 'This is a multi-part message in MIME format.'.$eol.$eol;
$body .= '--'.$boundary.$eol;
$body .= 'Content-Type: text/plain; charset=UTF-8'.$eol;
$body .= 'Content-Transfer-Encoding: 8bit'.$eol;
$body .= $eol.stripslashes($message).$eol;
if (!empty($_FILES))
{
foreach ($_FILES as $key => $value)
{
if ($_FILES[$key]['error'] == 0)
{
$body .= '--'.$boundary.$eol;
$body .= 'Content-Type: '.$_FILES[$key]['type'].'; name='.$_FILES[$key]['name'].$eol;
$body .= 'Content-Transfer-Encoding: base64'.$eol;
$body .= 'Content-Disposition: attachment; filename='.$_FILES[$key]['name'].$eol;
$body .= $eol.chunk_split(base64_encode(file_get_contents($_FILES[$key]['tmp_name']))).$eol;
}
}
}
$body .= '--'.$boundary.'--'.$eol;
if ($mailto != '')
{
mail($mailto, $subject, $body, $header);
}
header('Location: '.$success_url);
}
catch (Exception $e)
{
$errorcode = file_get_contents($error_url);
$replace = "##error##";
$errorcode = str_replace($replace, $e->getMessage(), $errorcode);
echo $errorcode;
}
exit;
}
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>wysłana pomyślnie</title>
<meta name="generator" content="WYSIWYG Web Builder 15 - http://www.wysiwygwebbuilder.com">
<style>
body
{
background-color: #FFFFFF;
color: #000000;
font-family: Arial;
font-weight: normal;
font-size: 13px;
line-height: 1.1875;
margin: 0;
padding: 0;
}
</style>
<link href="css/base/jquery-ui.min.css" rel="stylesheet">
<style>
a
{
color: #0000FF;
text-decoration: underline;
}
a:visited
{
color: #800080;
}
a:active
{
color: #FF0000;
}
a:hover
{
color: #0000FF;
text-decoration: underline;
}
input:focus, textarea:focus, select:focus
{
outline: none;
}
.ui-dialog.ui-widget
{
font-size: 1em !important;
z-index: 9999 !important;
}
.wysłana-pomyślnieDialog1.ui-dialog
{
display: none;
margin: 0;
padding: 4px 4px 4px 4px;
}
.wysłana-pomyślnieDialog1.ui-dialog .ui-dialog-title
{
color: #333333;
font-family: Arial;
font-weight: normal;
font-size: 13px;
font-style: normal;
margin: 0;
}
.wysłana-pomyślnieDialog1.ui-dialog .ui-dialog-titlebar
{
font-weight: normal;
padding: 10px 10px 10px 10px;
}
.wysłana-pomyślnieDialog1.ui-dialog .ui-dialog-titlebar-close
{
outline: 0;
right: 10px;
}
.wysłana-pomyślnieDialog1, .wysłana-pomyślnieDialog1 .ui-corner-all
{
border-radius: 0px;
}
#wysłana-pomyślnieDialog1.ui-dialog-content
{
overflow: visible;
padding: 0;
}
.wysłana-pomyślnieDialog1 .ui-dialog-buttonpane .ui-dialog-buttonset
{
float: right;
}
.wysłana-pomyślnieDialog1 .ui-dialog-buttonpane
{
text-align: right;
}
#wb_wysłana-pomyślnieForm1
{
background-color: #FBFBFB;
background-image: none;
border: 0px solid #CCCCCC;
}
</style>
<script src="jquery-1.12.4.min.js"></script>
<script src="jquery-ui.min.js"></script>
<script>
function submitwysłana_pomyślnieForm1()
{
$("#wysłana-pomyślnieDialog1").dialog('open');
return true;
}
</script>
<script>
$(document).ready(function()
{
$("#wysłana-pomyślnieDialog1").dialog(
{
title: 'This is the title',
modal: true,
width: 90,
height: 100,
position: { my: 'center', at: 'center', of: window },
resizable: true,
draggable: true,
closeOnEscape: true,
show: false,
hide: false,
autoOpen: false,
classes: {'ui-dialog': 'wysłana-pomyślnieDialog1'}
});
});
</script>
</head>
<body>
<div id="wysłana-pomyślnieDialog1">
<iframe allowtransparency="true" frameborder="0" id="wysłana-pomyślnieDialog1-iframe" name="wysłana-pomyślnieDialog1-iframe" src="about:blank" style="width:100%;height:100%;border-width:0"></iframe>
</div>
<div id="wb_wysłana-pomyślnieForm1" style="position:absolute;left:364px;top:603px;width:100px;height:100px;z-index:1;">
<form name="wysłana_pomyślnieForm1" method="post" action="<?php echo basename(__FILE__); ?>" enctype="multipart/form-data" accept-charset="UTF-8" target="wysłana-pomyślnieDialog1-iframe" id="wysłana-pomyślnieForm1" onsubmit="return submitwysłana_pomyślnieForm1()">
<input type="hidden" name="formid" value="wysłana-pomyślnieform1">
</form>
</div>
</body>
</html>

Re: Contact form

Posted: Fri Jul 19, 2019 8:17 pm
by Pablo
I do not see the form on this page.
What is the exact URL of the page?

Re: Contact form

Posted: Fri Jul 19, 2019 8:38 pm
by ponton.z

Re: Contact form

Posted: Sat Jul 20, 2019 6:56 am
by Pablo
I'm sorry, but it does not look like you have republished all files.
This page is not the same as the code you have posted.

Re: Contact form

Posted: Sat Jul 20, 2019 7:59 am
by ponton.z
It's best to describe and show on screen projections how you create the entire procedure step by step. How is the problem on the site is send to the address zawadzkis@toja.net.pl. You can record a movie

Re: Contact form

Posted: Sat Jul 20, 2019 9:56 am
by Pablo
It's best to describe and show on screen projections how you create the entire procedure step by step
The tutorial describes exactly how to do it.

And based on the code you have done it right.
However, the page on the server is not the same as the code you have posted.
You will need to republish all files.

Re: Contact form

Posted: Sat Jul 20, 2019 11:48 am
by ponton.z
I will send you the page without any changes. There is a problem you would have to do if I asked the previous post
<?php
function ValidateEmail($email)
{
$pattern = '/^([0-9a-z]([-.\w]*[0-9a-z])*@(([0-9a-z])+([-\w]*[0-9a-z])*\.)+[a-z]{2,6})$/i';
return preg_match($pattern, $email);
}
if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['formid']) && $_POST['formid'] == 'wysłana-pomyślnieform1')
{
$mailto = 'yourname@yourdomain.com';
$mailfrom = isset($_POST['email']) ? $_POST['email'] : $mailto;
$subject = 'Website form';
$message = 'Values submitted from web site form:';
$success_url = './wysłana-pomyślnie.php';
$error_url = './błąd.php';
$eol = "\n";
$error = '';
$internalfields = array ("submit", "reset", "send", "filesize", "formid", "captcha_code", "recaptcha_challenge_field", "recaptcha_response_field", "g-recaptcha-response");
$boundary = md5(uniqid(time()));
$header = 'From: '.$mailfrom.$eol;
$header .= 'Reply-To: '.$mailfrom.$eol;
$header .= 'MIME-Version: 1.0'.$eol;
$header .= 'Content-Type: multipart/mixed; boundary="'.$boundary.'"'.$eol;
$header .= 'X-Mailer: PHP v'.phpversion().$eol;

try
{
if (!ValidateEmail($mailfrom))
{
$error .= "The specified email address (" . $mailfrom . ") is invalid!\n<br>";
throw new Exception($error);
}

$message .= $eol;
$message .= "IP Address : ";
$message .= $_SERVER['REMOTE_ADDR'];
$message .= $eol;
foreach ($_POST as $key => $value)
{
if (!in_array(strtolower($key), $internalfields))
{
if (!is_array($value))
{
$message .= ucwords(str_replace("_", " ", $key)) . " : " . $value . $eol;
}
else
{
$message .= ucwords(str_replace("_", " ", $key)) . " : " . implode(",", $value) . $eol;
}
}
}
$body = 'This is a multi-part message in MIME format.'.$eol.$eol;
$body .= '--'.$boundary.$eol;
$body .= 'Content-Type: text/plain; charset=UTF-8'.$eol;
$body .= 'Content-Transfer-Encoding: 8bit'.$eol;
$body .= $eol.stripslashes($message).$eol;
if (!empty($_FILES))
{
foreach ($_FILES as $key => $value)
{
if ($_FILES[$key]['error'] == 0)
{
$body .= '--'.$boundary.$eol;
$body .= 'Content-Type: '.$_FILES[$key]['type'].'; name='.$_FILES[$key]['name'].$eol;
$body .= 'Content-Transfer-Encoding: base64'.$eol;
$body .= 'Content-Disposition: attachment; filename='.$_FILES[$key]['name'].$eol;
$body .= $eol.chunk_split(base64_encode(file_get_contents($_FILES[$key]['tmp_name']))).$eol;
}
}
}
$body .= '--'.$boundary.'--'.$eol;
if ($mailto != '')
{
mail($mailto, $subject, $body, $header);
}
header('Location: '.$success_url);
}
catch (Exception $e)
{
$errorcode = file_get_contents($error_url);
$replace = "##error##";
$errorcode = str_replace($replace, $e->getMessage(), $errorcode);
echo $errorcode;
}
exit;
}
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>wysłana pomyślnie</title>
<meta name="generator" content="WYSIWYG Web Builder 15 - http://www.wysiwygwebbuilder.com">
<style>
body
{
background-color: #FFFFFF;
color: #000000;
font-family: Arial;
font-weight: normal;
font-size: 13px;
line-height: 1.1875;
margin: 0;
padding: 0;
}
</style>
<link href="css/base/jquery-ui.min.css" rel="stylesheet">
<style>
a
{
color: #0000FF;
text-decoration: underline;
}
a:visited
{
color: #800080;
}
a:active
{
color: #FF0000;
}
a:hover
{
color: #0000FF;
text-decoration: underline;
}
input:focus, textarea:focus, select:focus
{
outline: none;
}
.ui-dialog.ui-widget
{
font-size: 1em !important;
z-index: 9999 !important;
}
.wysłana-pomyślnieDialog1.ui-dialog
{
display: none;
margin: 0;
padding: 4px 4px 4px 4px;
}
.wysłana-pomyślnieDialog1.ui-dialog .ui-dialog-title
{
color: #333333;
font-family: Arial;
font-weight: normal;
font-size: 13px;
font-style: normal;
margin: 0;
}
.wysłana-pomyślnieDialog1.ui-dialog .ui-dialog-titlebar
{
font-weight: normal;
padding: 10px 10px 10px 10px;
}
.wysłana-pomyślnieDialog1.ui-dialog .ui-dialog-titlebar-close
{
outline: 0;
right: 10px;
}
.wysłana-pomyślnieDialog1, .wysłana-pomyślnieDialog1 .ui-corner-all
{
border-radius: 0px;
}
#wysłana-pomyślnieDialog1.ui-dialog-content
{
overflow: visible;
padding: 0;
}
.wysłana-pomyślnieDialog1 .ui-dialog-buttonpane .ui-dialog-buttonset
{
float: right;
}
.wysłana-pomyślnieDialog1 .ui-dialog-buttonpane
{
text-align: right;
}
#wb_wysłana-pomyślnieForm1
{
background-color: #FBFBFB;
background-image: none;
border: 0px solid #CCCCCC;
}
</style>
<script src="jquery-1.12.4.min.js"></script>
<script src="jquery-ui.min.js"></script>
<script>
function submitwysłana_pomyślnieForm1()
{
$("#wysłana-pomyślnieDialog1").dialog('open');
return true;
}
</script>
<script>
$(document).ready(function()
{
$("#wysłana-pomyślnieDialog1").dialog(
{
title: 'This is the title',
modal: true,
width: 90,
height: 100,
position: { my: 'center', at: 'center', of: window },
resizable: true,
draggable: true,
closeOnEscape: true,
show: false,
hide: false,
autoOpen: false,
classes: {'ui-dialog': 'wysłana-pomyślnieDialog1'}
});
});
</script>
</head>
<body>
<div id="wysłana-pomyślnieDialog1">
<iframe allowtransparency="true" frameborder="0" id="wysłana-pomyślnieDialog1-iframe" name="wysłana-pomyślnieDialog1-iframe" src="about:blank" style="width:100%;height:100%;border-width:0"></iframe>
</div>
<div id="wb_wysłana-pomyślnieForm1" style="position:absolute;left:364px;top:603px;width:100px;height:100px;z-index:1;">
<form name="wysłana_pomyślnieForm1" method="post" action="<?php echo basename(__FILE__); ?>" enctype="multipart/form-data" accept-charset="UTF-8" target="wysłana-pomyślnieDialog1-iframe" id="wysłana-pomyślnieForm1" onsubmit="return submitwysłana_pomyślnieForm1()">
<input type="hidden" name="formid" value="wysłana-pomyślnieform1">
</form>
</div>
</body>
</html>

Re: Contact form

Posted: Sat Jul 20, 2019 12:13 pm
by Pablo
This is not the HTML code of this page:
http://www.osiedle-kochanowka.pl/kontakt.php

- the code you posted seems to be correct
- if this is code the 'kontakt' page then please republish all fails for that page to the same location on the server.

it is important that you publish all files, because adding a dialog to the page will generate extra files.

Re: Contact form

Posted: Sat Jul 20, 2019 5:28 pm
by Pablo
The popup works like in the demo:
http://wysiwygwebbuilder.com/form_popup.html

If you need different functionality then you will need to implement your own script.

Re: Contact form

Posted: Sat Jul 20, 2019 5:51 pm
by ponton.z
Go to my website http://www.osiedle-kochanowka.pl/kontakt.php and send something you will be redirected to the page of success not like https://wysiwygwebbuilder.com/support/w ... -popup.php. Explain to me with your words. How do I make a contact form top I have to mark in it pages success and error or only in the other Dialog and move it to the only contacts page

Re: Contact form

Posted: Sat Jul 20, 2019 6:01 pm
by Pablo
There are two forms on the page. You can only have one for per page.

Please do one thing at a time. You are over-complicating things.

Re: Contact form

Posted: Sat Jul 20, 2019 6:05 pm
by ponton.z
What does two forms mean?

Re: Contact form

Posted: Sat Jul 20, 2019 6:17 pm
by Pablo
It means that there are 2 forms on the page.
Why did you add a second form?

Re: Contact form

Posted: Sat Jul 20, 2019 6:26 pm
by ponton.z
159/5000
This is the Toolbox contact form -> jQuery UI / Bootstrap -> Dialog
As dialog Is a form if you can configure it like the other one. He understands well.

Re: Contact form

Posted: Sat Jul 20, 2019 8:33 pm
by Pablo
It looks like you have it working now.

Re: Contact form

Posted: Sat Jul 20, 2019 11:44 pm
by ponton.z
So that you can record a video of how to create a form from Creating a Form with a popup confirmation with the button To prevent the user from submitting the same form again, it is probably a good idea to add a link to the success page another page.
It seems that something is not playing. He sent to the website http://www.osiedle-kochanowka.pl/kontakt.php

Re: Contact form

Posted: Sun Jul 21, 2019 6:43 am
by Pablo
I'm sorry I cannot create a video for you.
However, it seems to work now.

If you want to user to go to another page after the dialog has been displayed, you can add an event with a link to the button.

Re: Contact form

Posted: Sun Jul 21, 2019 11:36 am
by ponton.z
Byście mogli w dziale pomocy zrobić parę filmów instruktarzowych nowymi funkcjami np. ten formularz i inne nie każdy jest orłem.

Re: Contact form

Posted: Sun Jul 21, 2019 11:39 pm
by MGD4me
Byście mogli w dziale pomocy zrobić parę filmów instruktarzowych nowymi funkcjami np. ten formularz i inne nie każdy jest orłem.
You can also check YouTube. There are a number of very well produced videos already on-line. This is pretty basic stuff, really, but you do require a few skills.

Also, the 'Help' feature walks you through all the necessary steps, at least it did for me.