Call PHP file in HMTL form

0

I want to call a .PHP file, but I can not.

I have this script:

========

    <html>
<header>
    <title>Home Page</title>
</header>
<body>
<form method="post">
    <fieldset>
        <legend>O que deseja fazer?</legend>
        <table cellspacing="10">
            <tr>
                <td>
                    <input type="submit" value="Cadastrar" onclick="javascript: location.href='pagina.php';" />
                </td>
            </tr>
        </table>
    </fieldset>
</form>
</body>
</html>

=========

This script does not work. What do I do wrong?

Thanks for the help.

    
asked by anonymous 26.05.2017 / 19:27

3 answers

1

It depends, if you just want to redirect to the page in the click, you should create the link tag if not, the act is the register and you want to send data to work with them in PHP, the option of the augusto rafael is valid. Link Tag:

<a href="pagina.php">Cadastrar</a>
    
26.05.2017 / 19:41
0

Put in the form a action="pagina.php"

Example <form method="post" action="teste.php"></form>

    
26.05.2017 / 19:34
0

Desejo chamar um arquivo .PHP, porém não consigo.

Possuo esse script:

========

    <html>
<header>
    <title>Home Page</title>
</header>
<body>
<form method="post" action="pagina.php">
    <fieldset>
        <legend>O que deseja fazer?</legend>
        <table cellspacing="10">
            <tr>
                <td>
                    <input type="submit" value="Cadastrar"/>
                </td>
            </tr>
        </table>
    </fieldset>
</form>
</body>
</html>

<form action="pagina.php" method="POST">
    <input type="text" name="nome">
    
    <input type="submit" value="Ir para Pagina">
 </form>

Just use the action: D

    
26.05.2017 / 19:36