Re: Php code in html buttons

From: Date: Tue, 10 Jul 2007 23:24:29 +0000
Subject: Re: Php code in html buttons
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-258584@lists.php.net to get a copy of this message
Thanks man, that post made my day :D. - Dan ""k w"" <listxpc@gmail.com> wrote in message news:bb58f4be0707101559n3d1f6c4dnda1d5b1f9e384279@mail.gmail.com...
I'm trying to make a button execute some php code when the button is clicked. I'm not sure if it is the button i'm coding wrong or the php code. Here is the code I am using. <?php echo "<button action='<?php mysqli_query($connect,$query)?>'Click</button>"; ?> I've got all my variables stored in the php page, and I know they are all correct. But when I push the button it does nothing. I'm not quite sure what I am doing wrong. I have also tried <input type=button value="Click" OnClick= "<?php mysqli_query($connect,$query); ?>"> and <form onclick="<?php mysqli_query($connect,$query); ?>"> <input type=button value="Click"> </form> Obviously i'm a complete newbie. I'd appreciate any help. Thanks.


« previous php.general (#258584) next »