javascript - Passing a href value inside a php function on same page -
$disply_storage variable has list of value, want call storage_facility_id in php myfunction() cant understand how storage_facility_id values in myfunction()
<?php function myfunction(){ $x=$_post['storage_facility_id']; } ?> <!doctype html public "-//w3c//dtd html 4.01 transitional//en" "http://www.w3.org/tr/html4/loose.dtd"> <html> <head> <?php include('include/admin-header.php'); $disply_storage=edit_storage_facility(); ?> <script language="javascript" type="text/javascript"> function ilovephp() { b = "<?=myfunction();?>"; alert(b); } </script> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"> <title>untitled document</title> </head> <body> <form action="" method="post"> <?php ($i = 0 ;$i<count($disply_storage);$i++){?> <tr class="light-gray-bg"> <td align="center"><?php echo $disply_storage[$i]['add_facility_name'];?></td> <td align="center"><a href="storage_mapping.php?id=<?php echo $disply_storage[$i]['storage_facility_id'];?>"><img src="images/edit.png" border="0" /></td> <td align="center"><a onclick="javascript:return confirm_delete()" href="delete_facility.php?id=<?php echo $disply_storage[$i]['storage_facility_id'];?>"><img src="images/delete.png" border="0" /></td> <td><a href="javascript:changestatus(<?php echo $disply_storage[$i]['storage_facility_id'];?>)" title="<?=($rec['is_active']==1)?'turn off':'turn on'?>"> <?=($disply_storage[$i]['is_active']==1)?'<img src="images/active.gif" border="0">':'<img src="images/inactive.gif" border="0">'?> </a></td> </tr> <?php }?> </form><p> </body> </html>
i don't doing here take stab @ it.
first off, myfunction pretty nothing. guess want...
function myfunction(){ return $_post['storage_facility_id']; }
which makes no sense me can echo $_post var inline time. data going there page posted to.
Comments
Post a Comment