PHP - Get value of imput box, without a form?
Posted
by Dodi300
on Stack Overflow
See other posts from Stack Overflow
or by Dodi300
Published on 2010-04-05T18:31:06Z
Indexed on
2010/04/05
18:33 UTC
Read the original article
Hit count: 119
Hello. Does anyone know how I can get the value of an imput box, without having a form? I want a sumbit button, but instead of submiting a form, I want it to change data in a MySQL database. Something like this maybe?
$img1="WHAT DO I PUT HERE?"
$idx=1
$sql="INSERT INTO games SET img1='$img1' WHERE id=$idx";
$result=mysql_query($sql);
Could I use that code on a "onclick" event? The imput box is named "img1".
Thanks for the help!
© Stack Overflow or respective owner