Re: [PHP] How I can create....
Hello Jason Thanks I understand now, but tell me someting, PHP don't have any function that create a button??? When I want to clean a DB I have to call another page always tell me you don't have any code for example that do the same thing that I want to do??? Thanks again Yusda --- Hola Jason Gracias ahora yo entiendo porque no trabajaba, pero dime una cosa, PHP no tiene ninguna funcion que cree un botton??? Cuando yo quiero borrar una DB Yo tengo que llamar otra pagina obligatoriamente??? Dime tu no tienes ningun codigo de ejemplo donde yo pueda ver como se hace esto que quiero hacer? Gracias de nuevo Yusda -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How I can create....
Hello to everyone. I want to clean a field from my Data Base in MySQL from a button. But I don't know how i can create a button in PHP, the funtion of button is TRUNCATE TABLE(Table). I have a form in HTML but hi don't work because when I press the button he don't do anything, but when i press the button submit he work I don't know way!!! Here are the Form HTML Code: FORM Name=Form1 METHOD=post Nick : INPUT TYPE=text NAME=nick SIZE=20 MAXLENGTH=20 BR Email: INPUT TYPE=text NAME=email SIZE=28 MAXLENGTH=100 BR Password: INPUT TYPE=password NAME=password SIZE=28 MAXLENGTH=20 BR Nombre: INPUT TYPE=text NAME=nombre SIZE=28 MAXLENGTH=255 BR INPUT TYPE=submit CLASS=boton VALUE=Registrar INPUT TYPE=reset name=Submit value=Restablecer INPUT TYPE=button name=CleanBD value=Limpiar BD onClick=?Limpiar()? /FORM and here are the code in PHP: function Limpiar() { $servidor = localhost ; $usuario = usuario ; $contrasena = password ; $basededatos = bd ; $conectar = mysql_connect($servidor, $usuario, $contrasena); mysql_select_db($basededatos,$conectar) ; $Limpiar = Truncate table bd; mysql_query($Limpiar); } how I cant create a button in PHP that he make the same function thanks Yusdaniel
Re: [PHP] How I can create....
the reason it doesnt work, is becuase you have muddied the requests for the client and the server. PHP is completely server side, so putting a php function name in onclick, which will execute client side code doesnt work. the solution would be to have you button reload the page, or submit to another page, that has your function call on it. make sense? Jason Yusdaniel Rodriguez Espinosa [EMAIL PROTECTED] wrote: Hello to everyone. I want to clean a field from my Data Base in MySQL from a button. But I don't know how i can create a button in PHP, the funtion of button is TRUNCATE TABLE(Table). I have a form in HTML but hi don't work because when I press the button he don't do anything, but when i press the button submit he work I don't know way!!! Here are the Form HTML Code: FORM Name=Form1 METHOD=post Nick : INPUT TYPE=text NAME=nick SIZE=20 MAXLENGTH=20 BR Email: INPUT TYPE=text NAME=email SIZE=28 MAXLENGTH=100 BR Password: INPUT TYPE=password NAME=password SIZE=28 MAXLENGTH=20 BR Nombre: INPUT TYPE=text NAME=nombre SIZE=28 MAXLENGTH=255 BR INPUT TYPE=submit CLASS=boton VALUE=Registrar INPUT TYPE=reset name=Submit value=Restablecer INPUT TYPE=button name=CleanBD value=Limpiar BD onClick=?Limpiar()? /FORM and here are the code in PHP: function Limpiar() { $servidor = localhost ; $usuario = usuario ; $contrasena = password ; $basededatos = bd ; $conectar = mysql_connect($servidor, $usuario, $contrasena); mysql_select_db($basededatos,$conectar) ; $Limpiar = Truncate table bd; mysql_query($Limpiar); } how I cant create a button in PHP that he make the same function thanks Yusdaniel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php