1 / 7

IS 118 Introduction to Development Tools

Learn general rules and key concepts of PHP development. Explore an example code snippet and understand the basics of HTML and PHP formatting. Get insights into creating forms, tables, and input elements in PHP coding.

cmaglio
Download Presentation

IS 118 Introduction to Development Tools

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. IS 118 Introduction to Development Tools Week 1 part 2

  2. Some general rules and things to know about PHP • Example on Pg 13 – Listing 1.1 • Html code is enclosed in angles < >, PHP uses the same format • In general you use lower case for commands • <table border=“0”> - note the double quotes • This means that it is a literal, a value being supplied • Each command that is started has to be ended • Eg < table > has to end with </table> • You use a plain text editor such as notepad (within windows) to write your code. You can not use MS Word or Wordpad

  3. Listing 1.1 • Let’s look a bit at the code • So < form action=“processorder.php” method=“post”> • Means this is a form we are creating, named processorder.php and we are going to post it or show it • <table border=“0” means create a table that I am defining • < tr bgcolor=“#cccccc”> create a row in the table • <td width=“150”>Item</td> this creates a column in the row, size 150 and put the text Item in it., end the definition with </td> • <td width=“15”>Quantity</td> create a second column, width 15, put Quantity in it • </tr> end of the row definition

  4. Listing 1.1 continued • Next row <tr> is all that is needed because the widths are known • <td>Tires</td> put tires in the column • <td align=“center”><input type=“text” name=“tireqty” size=“3” maxlength=“3” /></td> • </tr> • This one is complicated looking isn’t it – • So lets take it apart:

  5. Listing 1.1 continued • <td align=“center”><input type=“text” name=“tireqty” size=“3” maxlength=“3” /></td> • This column is going to get input, we know this because it says input type=“text” • The input will be centered • The name of the input is tireqty • The size of the input is 3 and the maximum size is 3

  6. Listing 1.1 continued • Last thing for this listing is: • <tr> • <td colspan="2" align="center"><input type="submit" value="Submit Order"></td> • </tr> • </table> end definition of the table • </form> end definition of the form

  7. <td colspan="2" align="center"><input type="submit" value="Submit Order"></td> • Colspan=“2” says this row will span both columns making it like one • The contents of the column will be centered • The input type is “submit” • With a value of “Submit Order” • This creates a submit button

More Related