您的位置:首页 > 编程语言 > PHP开发

strtoupper.php

2016-04-11 08:43 555 查看
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>

 <head>

  <title> strtoupper.php </title>

  <meta charset="UTF-8">

  <meta name="Author" content="">

  <meta name="Keywords" content="">

  <meta name="Description" content="">

 </head>

 <body>

<form method="post" action="">

 <input type="text" name="usrname" value=<?php echo '"' . (isset($_POST["usrname"])?$_POST["usrname"]:"") . '"' ?> ><br>

 <input type="submit">

</form>

<br>usrname:<br>

<?php

if(isset($_POST["usrname"]))

{

 echo strtoupper($_POST["usrname"]);

}

?>

<hr>

 </body>

</html>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>

 <head>

  <title> strtoupper.php </title>

  <meta charset="UTF-8">

  <meta name="Author" content="">

  <meta name="Keywords" content="">

  <meta name="Description" content="">

 </head>

 <body>

 <script type="text/javascript">

 function show_str()

 {

  str=document.getElementById("username").value;

  alert(str.toUpperCase());

 }

 </script>

<form method="post" action="">

 <input id="username" type="text" name="usrname" value=<?php echo '"' . (isset($_POST["usrname"])?$_POST["usrname"]:"") . '"' ?> ><br>

 <input type="submit" onclick="show_str()">

</form>

<br>usrname:<br>

<?php

if(isset($_POST["usrname"]))

{

 echo strtoupper($_POST["usrname"]);

}

?>

<hr>

 </body>

</html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: