I'm to stupid for using $.ajax
the html:
- <div><form action="" method="post"><input id="submit" name="ubernehmen" onclick="register()" style="width:auto; color:#000;" type="submit" value="Daten übernehmen" /></form></div>
the js:
- function register(){
$.ajax({
type: "POST",
url: "ubergabe.php",
success: function() {
$('#msg').html("test");
}
});
}
the php (ubergabe.php):
- <?php
$link = mysql_connect('localhost', '*****', '*****');
if (!$link) {
die('keine Verbindung möglich: ' . mysql_error());
}
echo 'Verbindung erfolgreich';
/* echo "geklappt";
mysql_connect ("localhost", "vogelsql2", "$vogel$") or die ('Error: ' . mysql_error()); */
mysql_select_db("vogelsql2");
mysql_query("UPDATE test SET price = '1'
WHERE id = '2'");
?>
The PHPfile is correct cause when i start this file directly it doas work.