Your SlideShare is downloading. ×
Table through php
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Table through php

1,946
views

Published on

enter rows and column and make table on click :)

enter rows and column and make table on click :)

Published in: Technology

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,946
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. AssignmentTopic:Table in oop Table.html<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0Transitional//EN"
  • 2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html;charset=utf-8" /><title>Untitled Document</title><script type="text/javascript">function validate(){var row=document.getElementById("txtrows").value;var column=document.getElementById("txtcolumns").value;if(row!="" && column !=""){return true;
  • 3. }else { return false; }}</script></head><body><form method="post" action="table.php">rows:<input type="text" name="Rows" id="txtRows" /><br />columns:<input type="text" name="Columns"id="txtColumns" />
  • 4. <br /><input type="submit" value="Show Table"onclick="return validate()" /></form></body></html> Table Class<?phpclass drawtable{function drawtable(){} public function draw($rows,$columns){ ?> <table border="1"> <?php for($i=0;$i<$rows;$i++){ ?>
  • 5. <tr> <?php for($j=0;$j<$columns;$j++){ ?> <td>Column</td> <?php } ?> </tr> <?php } ?> </table> <?php }}?>
  • 6. Table.php:<?phpinclude("table.php"); $rows=$_REQUEST[Rows]; $columns=$_REQUEST[Columns]; $obj= new drawtable(); $obj->draw($rows,$columns);?>

×