C
C
CSSwar2015-09-28 21:33:01
PHP
CSSwar, 2015-09-28 21:33:01

navigation block?

Good evening/night.
Tell me please. How to implement a form with pagination.
Here's what I mean:
At the top it says for example:
Job details->General information->Personal data.
At each stage, a form is filled out. Then all the data is sent to the server.
How is it implemented?
I know that cookies should like to participate.
Perhaps there is an article or lessons. Or written about it somewhere.
Or can you show/share the code?
I do it on bootstrap + it's also Bitrix.
Thanks in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivanq, 2015-09-28
@Ivanq

Cookies may or may not be used.
The essence of the code: everything happens on one page, when the first form is filled, php receives "send" via POST and shows the second form, adding the inputs of the first form hidden

<?php if(isSet($_POST["send3"])) { ?>
    Вы все заполнили!<br>
    A: <?=$_POST["a"]?>, B: <?=$_POST["b"]?>, C: <?=$_POST["c"]?>, D: <?=$_POST["d"]?>, E: <?=$_POST["e"]?>, F: <?=$_POST["f"]?>
<?php else if(isSet($_POST["send2"])) { ?>
    <form method="post">
        <input type=hidden name=a value="<?=htmlspecialchars($_POST['a'])?>">
        <input type=hidden name=b value="<?=htmlspecialchars($_POST['b'])?>">
        <input type=hidden name=c value="<?=htmlspecialchars($_POST['c'])?>">
        <input type=hidden name=d value="<?=htmlspecialchars($_POST['d'])?>">
        Поле E: <input type=text name=e><br>
        Поле F: <input type=text name=f><br>
        <input type=hidden name=send3>
        <input type=submit value="Далее">
    </form>
<?php else if(isSet($_POST["send1"])) { ?>
    <form method="post">
        <input type=hidden name=a value="<?=htmlspecialchars($_POST['a'])?>">
        <input type=hidden name=b value="<?=htmlspecialchars($_POST['b'])?>">
        Поле C: <input type=text name=c><br>
        Поле D: <input type=text name=d><br>
        <input type=hidden name=send2>
        <input type=submit value="Далее">
    </form>
<?php } else { ?>
    <form method="post">
        Поле A: <input type=text name=a><br>
        Поле B: <input type=text name=b><br>
        <input type=hidden name=send1>
        <input type=submit value="Далее">
    </form>
<?php } ?>

PS. Haven't checked
PSS yet. read the code below

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question