TY_BCA_AWT_SLIP 17_1



17.    To create form that accept the user details. write php program to capitalize of first letter of each name and check user email address contain @ symbol.

Html file :

<html>
<body>
<form action=Que14.php method=get>
<center>
Full Name  :<input  type=text  name=nm>
<br><font color=red  size=2>(Format is:First,Middle,Surname) </font>
<br>Email ID :<input type=text  name=eid>
<br><input  type=submit  value=Show>

</center>
</form>
</body>
</html>




Php file :

<?php

  $nm=$_GET['nm'];

  $eid=$_GET['eid'];

  echo "<br>Capitalization of each word of each name :".ucwords($nm);

$e=explode('@',$eid);

If (count($e)==2)
  {
       echo "<br>Email id contains @ symbol ";
           }
else  echo "<br>email id doesn’t contains  @ symbol  or contains  more @ symbol";

?>


1 comment:

Note: only a member of this blog may post a comment.