如何在Metro ui 4对话框中显示php提交表单的结果?

时间:2019-06-07 20:28:44

标签: php dialog metro-ui-css

我是新来的。请让我知道,如果我使用php表单发布一些数据,而不是如何在Metro UI 4对话框中显示结果。将PHP表单提交为php self后,我尝试打开Metro UI 4对话框。通常,结果是通过echo,print,printf等显示的,但是我只想在Metro UI 4对话框中显示结果。我正在学习https://metroui.org.ua。这是test.php文件和html表单。

if(!empty($_POST)) {
$sname=filter_input(INPUT_POST, 'stud_name', FILTER_SANITIZE_STRING);
$fname=filter_input(INPUT_POST, 'father_name', FILTER_SANITIZE_STRING);


printf('
<div class="dialog" data-role="dialog">
    <div class="dialog-title">Use Windows location service?</div>
    <div class="dialog-content">
        Hallo %s, YOur fathers name is %s.
    </div>
    <div class="dialog-actions">
        <button class="button js-dialog-close">Disagree</button>
        <button class="button primary js-dialog-close">Agree</button>
    </div>
</div>
',$sname, $fname);
include_once 'test.php';
<form data-role="validator" method="POST" action="<?php echo filtr_url($_SERVER['PHP_SELF']); ?>" enctype="multipart/form-data" class="mt-2" id="registerstud" name="register_student">

    <div class="row mb-2">
        <div class="cell-md-6">
            <label>Name</label>
            <input type="text" data-validate="required minlength=6" placeholder="Enter name" id="sname" name="stud_name">
            <span class="invalid_feedback">
                Input correct name with min length 6 characters
            </span>
        </div>
        <div class="cell-md-6">
            <label>Father's Name</label>
            <input type="text" data-validate="required minlength=6" placeholder="Enter name" id="fname" name="father_name">
            <span class="invalid_feedback">
                Input correct name with min length 6 characters
            </span>
        </div>
    </div>
    <button class="button primary">Submit</button>
</form>

我希望结果将显示在Metro ui 4对话框中。

0 个答案:

没有答案