简易聊天室中,如何实现发言之后光标仍然定位在空的text框里? form名f表单名tthis.document.f.t.focus(); 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 请问楼上的,这些代码加入到哪里呢?用到this.document是不是要先引入dom呢?这是源代码,请指出在哪里修改.谢谢<? session_start(); ?><!-- 用户发言页面 --><html> <head> <title>Post</title> </head> <body bgcolor="gray"> <?php require_once("sys_conf.inc"); //import system configuration file of database //speak if(isset($_POST["text"])){ //connect to a database $link_id = mysql_connect($DBHOST,$DBUSER,$DBPWD); mysql_select_db($DBNAME); $time = date("h:i:s"); $author = $_SESSION["user_name"]; $str = "INSERT INTO chat(create_time,author,text) values('$time','$author','$text');"; mysql_query($str,$link_id); //post words to the db mysql_close($link_id); } ?> <!-- 输入发言的表单 --> <form action= "speak.php" method= "post" target= "_self"> <input type= "text" name= "text" size= "100"> <input type= "submit" value= "Post"> </form> </body></html> <? session_start(); ?><!-- 用户发言页面 --><html> <head> <title>Post</title> </head> <body bgcolor="gray" onload="document.form1.text.focus()"> //修改1 <?php require_once("sys_conf.inc"); //import system configuration file of database //speak if(isset($_POST["text"])){ //connect to a database $link_id = mysql_connect($DBHOST,$DBUSER,$DBPWD); mysql_select_db($DBNAME); $time = date("h:i:s"); $author = $_SESSION["user_name"]; $str = "INSERT INTO chat(create_time,author,text) values('$time','$author','$text');"; mysql_query($str,$link_id); //post words to the db mysql_close($link_id); } ?> <!-- 输入发言的表单 --> <form action= "speak.php" method= "post" target= "_self" name="form1"> // 修改2 <input type= "text" name= "text" size= "100"> <input type= "submit" value= "Post"> </form> </body></html> move_uploaded_file正常使用后页面空白,非post 关于但双引号以及加号、点号的问题 PHP 实现胜负关系排名 请教段php代码的写法 请问用get方法获取带有"+"的数据,只能获取到"+"前面的怎么办? html的规范? 连接access成功,但是却读不出来里面的数据,急!!! 求多行匹配的正则表达式 ForntPage中插入数据库不好使啊~~ 我從來沒寫過LINUX下的程序,請哪位大俠幫幫忙 关于php+xml 格式化读取文件
<!-- 用户发言页面 -->
<html>
<head>
<title>Post</title>
</head>
<body bgcolor="gray">
<?php
require_once("sys_conf.inc"); //import system configuration file of database
//speak
if(isset($_POST["text"])){
//connect to a database
$link_id = mysql_connect($DBHOST,$DBUSER,$DBPWD);
mysql_select_db($DBNAME);
$time = date("h:i:s");
$author = $_SESSION["user_name"];
$str = "INSERT INTO chat(create_time,author,text) values('$time','$author','$text');";
mysql_query($str,$link_id); //post words to the db
mysql_close($link_id);
}
?>
<!-- 输入发言的表单 -->
<form action= "speak.php" method= "post" target= "_self">
<input type= "text" name= "text" size= "100">
<input type= "submit" value= "Post">
</form>
</body>
</html>
<!-- 用户发言页面 -->
<html>
<head>
<title>Post</title>
</head>
<body bgcolor="gray" onload="document.form1.text.focus()"> //修改1
<?php
require_once("sys_conf.inc"); //import system configuration file of database
//speak
if(isset($_POST["text"])){
//connect to a database
$link_id = mysql_connect($DBHOST,$DBUSER,$DBPWD);
mysql_select_db($DBNAME);
$time = date("h:i:s");
$author = $_SESSION["user_name"];
$str = "INSERT INTO chat(create_time,author,text) values('$time','$author','$text');";
mysql_query($str,$link_id); //post words to the db
mysql_close($link_id);
}
?>
<!-- 输入发言的表单 -->
<form action= "speak.php" method= "post" target= "_self" name="form1"> // 修改2
<input type= "text" name= "text" size= "100">
<input type= "submit" value= "Post">
</form>
</body>
</html>