Jump to content


Photo

Forms and calling Functions?


  • Please log in to reply
2 replies to this topic

#1 saphiire

saphiire
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 14 October 2006 - 11:33 AM

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

#2 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 14 October 2006 - 01:50 PM

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.

#3 saphiire

saphiire
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 15 October 2006 - 01:13 PM

Thanks for this ill look into it  ;D




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users