saphiire Posted October 14, 2006 Share Posted October 14, 2006 Hello All,Im just after a bit of guidance i've been stuck on this for a while. I am using a read only textbox on a website drawing information form a mysql database hoping to fill the textbox. Im hoping to either have a link or a button to call a php function that will increase a counter pulling the next bit of information captured from the database, but this is not the problem i can solve this.The problem is I cant seem to figure out how in a form to have an onclick or even a link to call a php function within the webpage which is written in php. THis function will just call another line of code and refill the text box. I cant seem to figure out how to for e.g create nextthree(); with the click of a mouse, maybe ive spent to much time on it today.Then again im thinking this perhaps should be done in Javascript after the database table has been taken through php but how to take the variable and contents from php and transfer them directy through to javascript. Any guidance would be fantastic.Kind Regards,Saphiire Quote Link to comment https://forums.phpfreaks.com/topic/23930-forms-and-calling-functions/ Share on other sites More sharing options...
wildteen88 Posted October 14, 2006 Share Posted October 14, 2006 You cannot run a PHP function when you click a link/button/image or whatever. PHP is not like javascript where you can fire a function when ever user clicks something. PHP runs on the server.The only way to do it is by looking into a technique called pagination which you'll be able to adapt into your script. Or you can use javascript, however you'll want to look up on the HttpRequest method. Quote Link to comment https://forums.phpfreaks.com/topic/23930-forms-and-calling-functions/#findComment-108784 Share on other sites More sharing options...
saphiire Posted October 15, 2006 Author Share Posted October 15, 2006 Thanks for this ill look into it ;D Quote Link to comment https://forums.phpfreaks.com/topic/23930-forms-and-calling-functions/#findComment-109034 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.