Jump to content

Calling a javascript function from php


alena1347

Recommended Posts

I need to call a javascript or a php function from a form made in php, so that I could make change in data base on clicks.

1)I included the function on onclick event on submit but nothing happens.

2)The file name in which this code is include is view_users.php

 

could someone hel me solve this

 

 

 

 

<?php

 

mysql_select_db("programmers") or die(mysql_error());

 

$data = mysql_query("SELECT * FROM user_allotment")

or die(mysql_error());

 

while($info = mysql_fetch_array( $data ))

{

echo "<tr>";

echo "<td>".$info['id'] . "</td>";

echo "<td>".$info['uname'] . "</td> ";

echo "<td>".$info['password'] . "</td>";

$id=$info['id'];

echo "<form method="post" action="view_users.php">";

echo "<td><label><input type="button" name=/"$id/" value="edit" align="middle" onclick="edit()"/></label></td>";

echo "<td><label><input type="button" name=/"$id/" value="delete" align="middle" onclick="edit()"/></label></td>";

echo "<td><label><input type="checkbox" name=/"$id/" value="privilege" align="middle" onclick="edit()"/></label></td>";

echo "</form>";

echo "</tr>";

}

?>

Link to comment
https://forums.phpfreaks.com/topic/273771-calling-a-javascript-function-from-php/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.