Hexagora Forum
Hexagora Forum
Home | Profile | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Dynamic HTML Editor
 Dynamic HTML Editor
 Button to run PHP function
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

ikeas68
Novice

5 Posts

Posted - 19 May 2012 :  16:56:54  Show Profile  Visit ikeas68's Homepage  Reply with Quote
hello i want to do this

<?php
function mYFunction() {
echo "Works";
}?>
</head>
<body>
<form>
<INPUT TYPE=BUTTON OnClick="<?php myFunction(); ?>" VALUE="CLICK ME">

how i can have this code generated ?

s.dav
Site Admin

Italy
3364 Posts

Posted - 22 May 2012 :  09:00:42  Show Profile  Visit s.dav's Homepage  Reply with Quote
The sample you posted does nothing useful; it simply replaces the "<?php myFunction(); ?>" string in your sample with "Works"...
Simply add an onclick event to a button but don't expect that clicking the button will call your php fuction...
In your sample the function will be called when the page loads...

Regards, Davide
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Hexagora Forum © s.dav Go To Top Of Page
Snitz Forums 2000