|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th-1:00PM EST. Register Today!
|
|
#1
|
|||
|
|||
|
php-help needed in calling a function using onclick-urgent
<?php
require($DOCUMENT_ROOT . "test50.php"); ?> <?php $a=0; function callfunc($a) { $result2 = mysql_query("SELECT * FROM `student1` LIMIT $a, 10 "); echo "<table border='1'>"; echo "<tr>"; echo "<th>NAME</th><th>ROLLNO</th><th>CLASS</th><th>CONTACTNO</th>"; echo "</tr>"; while($row2 = mysql_fetch_array($result2)) { echo "<tr>"; echo "<td>".$row2['name'] . "<td>" . $row2['rollno'] . "<td>" .$row2['class'] . "<td>" . $row2['contactno']; echo "</tr>"; echo "<br />"; } echo "</table>"; } callfunc($a); echo "$a"; echo "<br />"; $a+=10; echo "<br />"; echo "$a"; //echo '<INPUT type="button" value="NEXT" onClick="callfunc($a);" />'; mysql_close($con); ?> <INPUT type="button" value="NEXT" onClick="callfunc(<?php echo $a ?>);" /> </script> </body> </html> |
|
#2
|
|||
|
|||
|
RE: php-help needed in calling a function using onclick-urgent
Your function function callfunc($a) is a PHP function that resides in a .php file on the server. You cannot "call" this function by placing it in a link or in any javascript event in the browser.
The way to do this to make the code of the function its own .php file, then put the URL of this file in the link or in the javascript event. Since you have this in an <input field, are you attempting to have a form submit data to your php file? If so, you need to code a proper form with <form ...>your form fields here</form>. When you submit the form, it will "call" the .php file that is given in the action="..." parameter. |
|
#3
|
|||
|
|||
|
RE: RE: php-help needed in calling a function using onclick-urgent
thank u but,i have mangaed to get the first 10 values from the database and whn i click on the button now its not showing the next ten values.my question is how do we refresh the page to get the new values and also the button problem still exist.As u have said i am using a form and doing all these activities
Quote:
|
|
#4
|
|||
|
|||
|
RE: RE: php-help needed in calling a function using onclick-urgent
Quote:
Let me try it out will get bac to you! |
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Applications > php-help needed in calling a function using onclick-urgent |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|