1.PHP
a.PHP -> HTML & JavaScript
html程式碼中
<input type="" readonly="readonly" style='background-color:#DCDCDC' value=<?php echo $perinfo[ID];?> />
JavaScript程式碼中
文
程式碼如下:
<script type="text/javascript"> var ability=<?php echo JSON($array);?>; </script>
<?php $dbcnx = @mysql_connect ( "localhost", "root", "1234" ); if (! $dbcnx) { echo ("Unable to connect to the " . "database server at this time."); exit (); } if (! @mysql_select_db ( "pms" )) { echo ("Unable to locate the joke " . "database at this time."); exit (); } mysql_query ( "SET NAMES 'GB2312'" ); $q=mysql_query("select * from ability where ALV = 1"); while($row=mysql_fetch_array($q)){ $array1[] = $row[AName]; } ?>
<form id="form" name="form" method="POST" action="do.php"> <input type="hidden" id="count" name="count" value="1"/> <input type="submit" name="Submit" value="Search"/> </form>
3.Java>
JavaScript程式碼中
<?php echo $_POST['count']; ?>
<script type="text/javascript"> var te = document.getElementById("count"); te.value = 1; </script>
2.html程式碼給php
程式碼如下:
<script type="text/javascript"> function f(){ var id = "2"; var a = document.getElementById("a"); a.href.replace("(n)", id); } </script>
<a id="a" href="http://www.php1.cn/"> b. JavaScript -> PHP