Html , php, mysql intro

1,633 views
1,542 views

Published on

Html , php, mysql intro

Published in: Education, Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,633
On SlideShare
0
From Embeds
0
Number of Embeds
36
Actions
Shares
0
Downloads
26
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Html , php, mysql intro

  1. 1. HTML , PHP , MYSQL J.JAGAN., M.C.A KANCHI LINUX USER GROUP
  2. 2. HTML<html> <html><head> </head> <head>LINUX</head><body> </body> <body>we are in</html> meeting</body> </html>Note:Save by extention “file_name.html”
  3. 3. HTML<html><body><form name=“a” action=“detail.php” method=post>NO:<input type=“text” name=“no” size=“10”>SEX:Male<input type=“radio” name=“sex” value=“male”>Female<input type=“radio” name=“sex” value=“female”>DEPARTMENT : <select name=“dept”> <option>MBA</option> <option>MCA</option> </select></form> </body></html>
  4. 4. ATTRIBUTES<br> = give break<a href=“path”>link_name</a> = for link<table> </table> = create table<tr> </tr> = insert table row<td> </td> = table definition<h1,2,3,4></h1,2,3,4> = predefined font<img src=“path”> = insert image
  5. 5. Php_manual.ico FIRST CODE<? php <html>echo “This is PHP”; <body>echo “<br>” ; <?php?> echo “This is PHP”; echo “<br>”; ?> </body> </html>
  6. 6. php<?php <?php$ variable_name; $a=10;echo “variable_name”; echo“$a”;?> ?>
  7. 7. phpLoop: if:<?php <?phpfor($a=1;$a<=5;$a++) $a=20; { $b=10; echo “$a”; if($a>$b) } {?> echo “A is greater”; } else { echo “B is greater; } ?>php
  8. 8. Form with php<html><body><form name=“a” action=“detail.php” method=post>NO:<input type=“text” name=“no” size=“10”>SEX:Male<input type=“radio” name=“sex” value=“male”>Female<input type=“radio” name=“sex” value=“female”>DEPARTMENT : <select name=“dept”> <option>MBA</option> <option>MCA</option> </select></form> </body></html>
  9. 9. detail.php<?php$no=$_POST[‘no’];$sex=$_POST[‘sex’];$dept=$_POST[‘dept’];echo “$no”;echo “<br>”;echo “$sex”;echo “<br>”;echo “$dept”;?>
  10. 10. mysql for insert<?php$conn = mysql_connect(localhost, root, ) or die(Could not connect: . mysql_error());echo ("Connected successfully");echo ( "<BR>");$rs=mysql_select_db(“stud",$conn) or die(cannot access);$sql=("insert into info values ($_POST[no],$_POST[sex],$_POST[dept]‘ )”);$rs=mysql_query($sql,$conn) or die(“not connected");echo("<br>");echo("DATA IS INSERTED");?>
  11. 11. For view<?php$link = mysql_connect(localhost, root, ) or die(Could not connect: . mysql_error());echo Connected successfully."<BR>";mysql_select_db(“stud”,$link) or die(cannot access);$sql="select *from info";
  12. 12. echo "<table table color=red border=10 bordercolor=green ><tr bgcolor=cyan><TH>NO</TH><TH>SEX</TH><TH>DEPT</TH></tr>";while(($row=mysql_fetch_array($rs))){echo("<tr>");echo("<td>" . $row[“no"]. "</td>");echo("<td>" . $row[“sex"] . "</td>");echo("<td>" . $row[“dept"]."</td>");echo("</tr>");}echo("</table>");
  13. 13. THANK YOUWILL SEE ON NEXT SUNDAY ANY QUIRES ?

×