Keresés

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

  • SektorFlop

    aktív tag

    válasz Sk8erPeter #2373 üzenetére

    nem sikerül összehoznom...
    mobil.php fájlom ahol a form található...

    <div data-role="page" id="mailcsere">
    <div data-role="header">
    <h1>E-mail módosítás</h1>
    </div>
    <div data-role="content">
    <form action='/' method='post' id="mailcsere">
    <input type='text' name='email' />
    <input type='submit' value='Módosítás' />
    </form>
    <script>
    /* attach a submit handler to the form */
    $("#mailcsere").submit(function(event) {

    /* stop form from submitting normally */
    event.preventDefault();

    /* get some values from elements on the page: */
    var $form = $( this ),
    term = $form.find( 'input[name="email"]' ).val(),
    url = $form.attr( 'action' );

    /* Send the data using post and put the results in a div */
    $.post( 'login/mailcsere.php', { email: term },
    function( data ) {
    var content = $( data ).find( '#content' );
    $( "#result" ).empty().append( content );
    }
    );
    });
    </script>
    </div>
    <div data-role="footer">
    <h4>Page Footer</h4>
    </div>
    </div>

    mailcsere.php

    <?
    session_start();
    $felhasznalo=$_SESSION['felhasznalo'];
    require_once ('connect.php');
    $email=$_POST['email'];
    $sql = "UPDATE `felhasznalok` SET email='$email' WHERE user='$felhasznalo';";
    if (mysql_query($sql)) {
    echo "<script type='text/javascript'>window.location='mobil.php?szerkezt=sikeres'</script>";
    exit;
    }
    else {
    echo "<script type='text/javascript'>window.location='mobil.php?szerkezt=sikertelen'</script>";
    }
    ?>

    a mobil.php fájlom azért néz ki így mert phonegap-el dolgozom, ezért is bajlódom a formokkal :W

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

Hirdetés