Keresés

Új hozzászólás Aktív témák

  • Forza_JUVE

    aktív tag

    válasz Sk8erPeter #10819 üzenetére

    Ez a Freeweb tárhely, a konfigurációs felület a: https://my.x3.hu/

    a form pedig jelenleg így fest:

    <?php
    $link = mysql_connect('sql', 'user', 'pwd');
    if (!$link) {
    die('Not connected : ' . mysql_error());
    }
    $db_selected = mysql_select_db('adatbázis', $link);
    if (!$db_selected) {
    die('Can not use : ' . mysql_error());
    }
    if (isset($_POST['name']) && isset($_POST['email'])) {
    $name = mysql_real_escape_string($_POST['name']);
    $email = mysql_real_escape_string($_POST['email']);
    $mysql = mysql_query("INSERT INTO 'táblanév' ('id', 'email', 'name') VALUES ('$email', '$name')");
    }
    ?>

    ez pedig a html:

    <!DOCTYPE html>
    <html lang="hu, hun, hungarian">
    <head>
    <meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
    <meta name="description" content="">
    <meta name="keywords" content="">
    <title>PHP</title>

    <!--[if IE]>
    <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->

    </head>
    <body>
    <form action="php.php" method="post">
    <div>
    <label for="name">Név: </label>
    <input type="text" name="name" id="name">
    <br />
    <br />
    <label for="email">E-mail: </label>
    <input type="text" name="email" id="email">
    <br />
    <br />
    <input type="submit" value="Elküld">
    </div>
    </form>
    </body>
    </html>

Új hozzászólás Aktív témák