Jump to content

Forms and calling Functions?


saphiire

Recommended Posts

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
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.